530 questions
0
votes
0
answers
114
views
Refit client returns cached responses despite no-cache headers and HttpMessageHandler
I'm experiencing a caching issue with Refit when calling Keycloak Admin API endpoints. Despite setting various no-cache headers and implementing a custom HttpMessageHandler, I'm still getting cached ...
0
votes
0
answers
103
views
How to force Squid forward proxy (with SSL-bump) to cache dynamic HTTPS API responses for a fixed TTL?
I'm using Squid as a forward proxy with SSL-bump to cache responses from a dynamic HTTPS API (e.g., https://www.uuidtools.com/api/generate/v4/count/1). The API always returns a new value and sends ...
0
votes
0
answers
46
views
dio_cache_interceptor package returns empty response body with maxStale : Flutter
I am exploring the dio_cache_interceptor package in Flutter. This package provides logic for implementing caching and handling the HTTP Status Code 304.
While testing this package I tested a ...
1
vote
1
answer
277
views
Weak vs strong ETag header
I have express.js based server and working on implementing etag HTTP header. So, I find out express has already etag and 304 status code implementation enabled. I was going through the code as found ...
2
votes
0
answers
73
views
HTTP Cache Not Expiring on Updated Pagy Records (Pagy Gem)
'm facing an issue with the Pagy gem in my Ruby on Rails application, where the HTTP cache does not expire when records are updated on pages other than the first page. Specifically, when any records ...
0
votes
0
answers
35
views
React/Axios API Response Not Updating Without Disabling Cache in DevTools
I'm encountering an issue where my API responses are not updating unless I disable cache in the browser's DevTools. Here are the details:
Problem: When I make API calls using axios in my React ...
2
votes
1
answer
77
views
Behaviour of express / browser as it relates to cache headers and 304 response codes
I am trying to understand the behaviour of cache headers and response codes.
Initially I have an express application that looks like this:
app.get("/users-a", async (req, res) => {
...
4
votes
0
answers
1k
views
How to set up Caching with ktor
Hi i am trying to set up caching for my ktor server. It also uses ktor client to make requests to some urls to fetch json files. I wanted to use In-Memory caching for the client but it does not seem ...
0
votes
0
answers
51
views
Using javascript cache mode vs cache-control header
What is the difference between using a cache-control header and the cache readonly property of the Request interface?
fetch('/foo', {
headers: {
'cache-control': 'no-store'
}
})
.then(res =>...
0
votes
0
answers
211
views
how to opt out of next js data cache
I have an app where the data is constantly changing, but with Next.js caching requests it's impossible for me to get updated data in time even do that data is updated in the database. I'm pointing to ...
0
votes
1
answer
2k
views
Why is caching not working while fetching Data on the Server with fetch?
I have created a post listing application and upon clicking on each post the user will be redirected to single details page of the post
index.js (list of posts)
export default function Home(props) {
...
0
votes
1
answer
947
views
http 307 redirect cacheability
Can 307 redirect be cached by browser?
I have a simple service, which redirects all requests to another URL using the 307 Temporary Redirect status code.
curl localhost:8081 -v
* Trying 127.0.0.1:...
2
votes
2
answers
683
views
Drupal 10.1 Aggregated CSS files Not Cached Due to New Query String
Since 10.1 an extremely long query string is being added to all aggregated css files.
delta=3&language=en&theme=hhc&include=...
2
votes
0
answers
175
views
Root document index.html hosted on CloudFront stuck in local browser cache
I have a CloudFront distribution with a single origin and behaviour mapped to an S3 bucket. This has been working fine for years.
Today I replaced the index.html file and invalidated the distribution ...
0
votes
1
answer
267
views
Why does OkHttp cache responses with expires -1 header?
I am contacting a server using OkHttp and the server responds with a 200 OK response with a header of expires: -1. OkHttp seems to place this in the cache because when I later send the same request ...
0
votes
0
answers
812
views
Revalidation max-age=0, must-revalidate, no-cache no risk 504
To indicate the need to check the validity of the saved cache before each subsequent request, we can use Cache-Control: no-cache with the validator (ETag or Date+Last-Modified) in the server response.
...
0
votes
1
answer
2k
views
How to cache a file in CloudFlare, but not in browsers? I tried “Cache Everything”. I tried “Cloudflare-CDN-Cache-Control”
I have an SPA where all the files on my domain are static. I'm using CloudFlare to cache them to reduce load on my server.
My goal would be to have CloudFlare cache all my files until my deploy script ...
1
vote
0
answers
368
views
Deploying Blazor WASM with caching dependencies
I'm trying to deploy my AOT-compiled Blazor WASM app as static resources served by a normal Asp.NET server.
This works. but I'm facing two issues with this.
The output seems unreasonably large. e.g ...
0
votes
1
answer
248
views
Varnish error "Uncached req.body can only be consumed once" by extracting response header from subrequest and add it to the original request
I have an api with jwt authentication (bearer token). The jwt is sent on every api request. For validating the jwt I have a specific route in my backend (GET /_jwt_user_sub). A request to this route ...
1
vote
1
answer
4k
views
How do you cache a nextjs page that has getServerSideProps?
pages/stuff.ts
export function getServerSideProps(context) {
const userId = getUserIdOrNull(context);
return {props: { somethingComplicated: getSomethingComplicated(!!userId) }};
}
export default ...
1
vote
2
answers
995
views
API to check if a site has been served from browser cache
We would like to know from where the initial html document itself was served, either directly from the browser cache, our cdn cache or from origin. The later are easy (since our cdn adds server-timing ...
6
votes
1
answer
10k
views
vite: Adding static assets(with cache busting) to the build
I have large static files which should be busted with a hash for HTTP-caching. If I put them into the public directory, vite only copies them without appending a hash to the filenames. If I put them ...
0
votes
0
answers
389
views
Activate symfony internal reverse proxy and link to only a redis server
I'd like my symfony application to use the symfony internal reverse proxy.
This is really easy:
# config/packages/framework.yaml
framework:
http_cache:
enabled: true
debug: true
...
0
votes
0
answers
852
views
Cloudfront with no-cache In request header not working
As we can use cloudfront for http cache / shared cache / as cdn.
cloudfront can cache based on Cache-Control headers received from origin (response headers)
But when I pass Cache-Control : no-cache as ...
0
votes
2
answers
381
views
How can I cache Redux states? (without redux-persist)
Problem
I want to save data in the store with Redux, like tokens and user-related data to be used across the whole application (I'm using React).
The problem is that Redux does not persist in the ...
23
votes
4
answers
10k
views
ASP.NET Core - difference between Output caching and Response caching
ASP.NET Core 7 preview 6 just introduced Output caching which caches the endpoint output. However ASP.NET already has Response caching which seems to already provide the same feature.
What is the ...
1
vote
0
answers
209
views
does max-age=0, must-revalidate revalidate with the origin server or a CDN?
many websites' html file uses cache-control: public, max-age=0, must-revalidate, like this one.
According to this MDN page, this is the same as Cache-Control: no-cache for most modern browsers. And I ...
1
vote
0
answers
289
views
Would browsers set If-Modified-Since or If-None-Match header in the new request after being redirected?
So I'm testing with this setup. https://example.com/original always responds with a 308 status code, redirecting the browser to https://example.com/new.
https://example.com/new checks if If-Modified-...
0
votes
1
answer
929
views
why we need to add app.UseResponseCaching();?
after following some cache tutorials in .ASP Net Core, and performed some local tests i have some doubts related:
Steps I did
I added the header
[ResponseCache(VaryByHeader = "User-Agent", ...
4
votes
0
answers
629
views
How to prevent http caching for javascript modules?
A brief introduction
First of all, I know, the question is often asked and I have read many discussion before asking.
Tipical approches to handle the cache problem that are suggested in other question ...
1
vote
1
answer
2k
views
How to cache ResponseEntity<Resource> in spring boot
I am trying to cache ResponseEntity in spring boot but unable to find a proper way to implement the same.
There are few examples where
return ResponseEntity.ok()
.cacheControl(...
2
votes
0
answers
3k
views
How to avoid repeated API call across an entire NextJS application?
This seems like a really simple thing to do, yet I am having trouble finding the right architecture to do this.
Here's the scenario:
We have an API route api/templates that should, in theory, happen ...
0
votes
1
answer
2k
views
HTTP Cache-Control header max-age vs max-age, must-revalidate
I want to find difference between max-age alone and max-age with must-revalidate in Cache-Control header.
I did verification on chrome with both of these.
max-age=10 - It means that the response is ...
2
votes
0
answers
970
views
Redis wait for key to be cached in GET request
I have two REST end-points
POST request, this request does some long running task and fills the key-value pair in the cache.
GET request this gets the data from the cache corresponding to a ...
3
votes
0
answers
1k
views
video element sends multiple network requests
I have a video element with a mp4 source
<video src="https://dh2jw0564x0cd.cloudfront.net/projects/6a30cb01-4414-4c50-ac7e-c2d9ac30358d/assets/videos/1646314487232_Big_Buck_Bunny_1080_10s_1MB....
1
vote
0
answers
384
views
Java HttpClient is not returning latest data from API
I'm running this code in Idea 2020.1 with Java 11 (of course!)
String gitApiPrUrl = "https://bitbucket.myserver.com/rest/api/1.0/projects/PRJ/repos/my-repo/pull-requests";
...
0
votes
1
answer
571
views
flush() and evictAll() not working for okhttp3 cache
I am accessing TestRail's API which has a 180 Req/min rate limit,
I am using okHttpClient for accessing it
To keep a count of a count of requests I am using okhttp cache
After every 180 Requests, I ...
2
votes
1
answer
1k
views
Cache-Control: max-age=0 with stale-while-revalidate value?
what happens if the max-age is zero but stale-while-revalidate has a value?
example: Cache-Control: max-age=0, stale-while-revalidate=60
will the stale-while-revalidate be taken into consideration at ...
0
votes
1
answer
622
views
HTTP Header Vary - Order of values
We serve files for our websites to which we add CORS headers. The Vary header is required for cache management at the CDN and browser level.
So the question: is there any importance in the order of ...
0
votes
1
answer
1k
views
How to call certain apis without caching a response in angular when using service worker?
I Have attached 2 images.
First Image is the very fist time when I load the website where the service-worker is registered. There are 2 arrow mark that shows 302 found and sets the cookies of session ...
-1
votes
1
answer
836
views
Symfony returning HTTP 304 locally, but HTTP 200 for matching ETag in production
Due to a heavy API call taking upwards of 20 seconds, I have enabled computation of ETag for that resource and pre-compute the ETag before doing any heavy DB work to be able to return early. This ...
0
votes
0
answers
41
views
PHP caching image https request
I have a very high I/O load on the server which causes 500 error many times per day while the CPU/RAM usage is basically non exsitent:
the main work of the server is serving images and videos. I'll ...
1
vote
1
answer
607
views
HTTP cache invalidation with API Platform and AWS CloudFront
I am trying to implement a HTTP cache invalidation with API Platform and AWS CloudFront and as I can read in API Platform documentation:
Support for reverse proxies other than Varnish can easily be ...
0
votes
2
answers
668
views
How to add providers, service and interceptor only for gift card module in angular?
I am implementing caching only for gift card module and I have created http-cache.service and cache interceptor.When I add the service in app.module.ts it works but I need to implement this separately ...
2
votes
1
answer
528
views
Saving the response cache to the server in Net 5
As in Net MVC, I want to save the response cache to the server (it's called outputcache), but there is no such feature in Net Core or Net 5. I couldn't find an alternative method. Thank you in advance....
3
votes
1
answer
3k
views
How to influence OkHttp cache usage?
You can add a cache to an OkHttpClient which will work according to the various cache-related HTTP header like cache-control:
val okHttpClient =
OkHttpClient.Builder().apply {
cache(Cache(...
7
votes
1
answer
7k
views
Force use of HTTP Cache with fetch
I'm trying to use the HTTP Cache for something simple, but I can't get it to work.
I'm using the following options for fetch().
fetch('test', {
cache: 'force-cache',
headers: {
...
1
vote
0
answers
384
views
"mini-css-extract-plugin" every time injects a new number in main.js file on each build which changing contenthash number of main.js unnecessarily
I am using webpack 5, and using contenthash for the main.js file. But my main.js file gets a new hash number on every build even if there is nothing changed in my application. When I compared two main....
1
vote
2
answers
2k
views
Delete cache of specific XHR call
I have a XMLHttpRequest that does a GET request:
const xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "myapi/getThing", true)
Normally, the response stays the same so the ...
4
votes
2
answers
4k
views
Difference in JSDelivr URL with & without "latest"
I went to GitHub issues to raise a support ticket but thought of asking the question first to avoid noise.
This is what the docs says-
Omit the version completely or use "latest" to load ...