Questions tagged [cache-control]
The HTTP `Cache-Control` header specifies directives which override default HTTP caching behaviour.
cache-control
1,437 questions
1
vote
2
answers
92
views
How to set Cache-Control to protected paths in a Spring Boot application?
I want to set Cache-Control: private header in a Spring Boot application but I was not able to find a way to set it for all of my protected paths.
I have the ...
1
vote
0
answers
55
views
How can I override the browser cache when I update my index.html page? [duplicate]
I'm self-learning web development. I have created a personal website using an "index.html" page, a "style.css" page, and a "script.js" page within VS Code. My website is ...
0
votes
0
answers
65
views
Browser is not loading resources from disk cache despite cache-control
I set the following response headers for my resource files: CSS, JavaScript, and images
...
1
vote
1
answer
133
views
When does browser (e.g. Chrome) add `Cache-Control: no-cache` to request header when user empty cache and hard reload?
When I open the dev tool and select Disable Cache, chrome adds Cache-Control: no-cache in request header for all requests.
But ...
0
votes
1
answer
41
views
HTTP caching of transitive resources using IF-Modified-Since
Given:
index.html
main.js
data.json
The initial requests for these files all return the same Last-Modified header value, but no ...
0
votes
0
answers
54
views
need to cache an access token from oauth url.How do I pass the cached access token to the next invoke policy
I need to cache an access token from oauth endpoint and use the access token to make a call to a backend endpoint. How do I pass the cached access token to the next invoke policy? I am using IBM API ...
2
votes
0
answers
66
views
Getting 304 (Not Modified) after new deploy in Firebase App Hosting
does anyone have understanding what is the caching policy for Firebase App Hosting service ?
When I deploy the new version of my web app written in Angular 19 and hit refresh in the browser - my web ...
1
vote
1
answer
52
views
Why mod_expires does not work for JS files
It looks like ExpiresByType in .htaccess file doesn't work for js files.
PageSpeed Insights:
Serve static assets with an efficient cache policy xx resources found
<...
0
votes
1
answer
67
views
How Can I Ensure ASPX Pages Don’t Cache After web.config Updates in ASP.NET Web Forms?
I’m working on a .NET wcf application with ASPX pages. Every time I update the web.config file (such as changing versioning), I want to make sure that none of the pages are cached and are always ...
0
votes
1
answer
157
views
Why isn't Safari (and iOS) caching my SVGs?
I have set up a server where Flask is running behind Nginx. I plan on using Nginx soon for static resources, however, I was interested in getting caching to work while serving resources from Flask. I ...
0
votes
1
answer
141
views
Auto refresh Cloudflare cache
I have an API that runs on GCP behind Cloudflare. To optimize response time I want to cache requests responses using Cloudflare cache.
When a cached resource becomes stale, the subsequent request has ...
0
votes
1
answer
200
views
Cache Storage vs IndexDB for short lived data
I need to handle a 500MB file upload where the user may be redirected to a login page and later return to resume the upload. To store the file temporarily, options like IndexedDB or CacheStorage seem ...
0
votes
2
answers
188
views
Does Cache-Control: s-maxage=31536000 guarantee no revalidation by intermediaries (CDN, proxies)?
I am trying to optimize the caching of versioned static files (e.g., style.abc123.css) served through a CDN or proxy cache. I am currently using the following HTTP header:
...
0
votes
1
answer
182
views
ETag update after resource modification
Let's assume I have the following 2 endpoints, which get and update a resource on my server:
GET /myResource
PUT /myResource
We would now like to implement browser caching to minimize the load on our ...
0
votes
1
answer
251
views
How to use the cloudflare worker cache as a fast KV?
I cant seem to get the Cloudflare cache working as described in the Cloudflare documentation https://developers.cloudflare.com/workers/runtime-apis/cache/
I am trying to use Cloudflare worker cache as ...
1
vote
0
answers
315
views
How do I have Cloudflare respect Cache-Control directives for a FastAPI App deployed on Digitalocean App Platform?
How do I have Cloudflare respect Cache-Control directives for a FastAPI App deployed on Digitalocean App Platform?
Problem
I'm experiencing an issue with caching in my FastAPI application when it's ...
1
vote
1
answer
273
views
Firebase App Hosting Cache-Control (NextJS)
I'm trying to set cache-control of one year for all of my files which is hosted in Firebase with the new App Hosting service (I'm new to Firebase but I've worked with multiple other clouds and never ...
-1
votes
1
answer
80
views
How to ensure browser caching [duplicate]
I have this in my htaccess file:
...
1
vote
1
answer
63
views
Is it possible to refresh a preloaded JSON in mobile Safari?
I use HTTP header Link to speed up loading of user data on my page:
Link: </api/GetUserData>; rel="preload"; as="fetch"
When user data ...
0
votes
1
answer
736
views
How to apply max-age in cache control for images in Nextjs?
I have created the following next.config.js file:
...
1
vote
0
answers
73
views
server side cacheing in graphql
I want to use GraphQL in NestJS. I'm using the first code in GraphQL. Now I want to add caching. I've set the following settings, but it's not using the cache. What's the problem? How can it be solved?...
2
votes
0
answers
726
views
Best way to propagate cache-control policy in a FastAPI application?
Using FastAPI and FastAPICache, we can use the Cache-Control header to allow the API ...
0
votes
1
answer
124
views
Why the rescource's caching time in Chrome is the result of Date plus max-age
I've found a curious question which confused me a lot. I have a HTML page that contains an image which is hosted on a CDN server. On first request (just a little before I uploaded the image), the ...
1
vote
1
answer
1k
views
How do I set the max age for a cache entry when calling fetch?
I may be fundamentally misunderstanding something here but it seems to me that if I want to fetch something I can call
let r = await fetch("someurl");
...
3
votes
2
answers
3k
views
How to Resolve Browser Cache Invalidation Issue in Vite-React Project Deployment? [closed]
Problem:
I'm encountering a persistent issue with my Vite-React project deployment. Whenever I deploy a new version, the changes are not immediately reflected on the production URL. Instead, they only ...
0
votes
2
answers
166
views
Okhttp caching system not working 504 Unsatisfiable Request (only-if-cached)
I want to cache 200 requests and retrive data from cache when don't have internet/meet some api errors, but cannot get any data from cache:
My network interceptor
...
-1
votes
1
answer
230
views
Is it possible to force a browser to use the same cache entry for different paths?
For example, there are 2 paths at the same domain: some_domain.com/first and some_domain.com/second.
Both of these paths return ...
1
vote
2
answers
421
views
okhttp cache-control no-cache processing strategy
I have a question about caching support in okhttp. This is a complex question, so I’ll break it into two parts.
1. no-cache processing strategy for request
I ...
3
votes
2
answers
713
views
Why does the browser force revalidation when serving an initial document request?
I do understand how Cache-Control header works. However, I noticed that the browser treats the document request differently from other requests. The document ...
1
vote
0
answers
677
views
NGINX : Static resources missing. Server response code 304
I'm posting here because I'm struggling to get my head around what seems to be a simple issue. The setup is the following :
Angular application uses static resources (such as fonts).
The angular app ...
0
votes
1
answer
256
views
Flutter: How to extend the age of the cached image
I am working on an application that involves a lot of image caching, to reduce database costs. I am using Cached_network_image with ...
1
vote
1
answer
1k
views
How do I add Cache-Control with no-cache and no-store header in Spring Boot?
I have Spring Boot 3.0.4 application and I have tried many things to add Cache-Control with no-store but either nothing happens or it says that headers or something is both enabled and disabled and ...
0
votes
1
answer
997
views
Nextjs cache and cloudflare cache are not synced with getStaticProps revalidation
I’m trying to test my nextjs application on digital ocean, I deployed it, and noticed that getStaticProps revalidation doesn’t work, I examined the cache headers and notice that the revalidation ...
0
votes
1
answer
95
views
object metadata (cache control) being deleted whenever new version uploaded?
Just what it says. I have objects in a bucket that is fully public. I have set the cache control metadata on each one to something (e.g. "public, max-age=60", or "no-store"). ...
1
vote
0
answers
343
views
How to stop Starlette from setting "Cache-Control: no-cache"?
I have a uvicorn / starlette app set up with:
...
1
vote
0
answers
160
views
2
votes
2
answers
3k
views
vercel deployed website doesn't update when github is updated
I have been facing the same problem in every project that I upload on vercel. When I commit and push some changes in a github repo connected with the vercel deployment, the vercel dashboard shows the ...
-1
votes
1
answer
166
views
Issue with Tastedive API in Data Collection and Processing with Python Course (University of Michigan Runstone Environment)
I'm currently working on an assignment for the "Data Collection and Processing with Python" course at the University of Michigan, using the Runstone code environment. The assignment involves ...
2
votes
1
answer
655
views
How to cache locally in browser when s-maxage > max-age
In short:
Let’s say s-maxage is one day and max-age is one hour. The proxy cache will keep a resource for a day, but after a few ...
0
votes
1
answer
82
views
HTTP Cach Control header not caching
I have node js with express server.
when i try simple api call it does caching the response but when i involve cors , somthing happens and the response doesnt caching. (i dont know if its only from ...
2
votes
1
answer
3k
views
How to prevent Next js app from caching my fetch call?
In my nextJS app, I am using fetch API which collects data from mongoDB to fetch a list of participants.
In local developing environment, and production with Netlify it works well.
But in local ...
0
votes
1
answer
602
views
How to add cache-control header to existing responseHeaderPolicy in aws CDK Cloudfront?
I have an AWS CDK Cloudfrount distribution with the default responseHeaderPolicy. I need to add a cache-control directive, but it seems that I have to create from scratch the whole ...
0
votes
0
answers
85
views
Reloading video in javascript every minute, but cache is preventing it
In a directory on server I have a number of videos (mp4 files). Every video is presented on its own web page, and all web pages are controled by javasript file.
Videos in source directory change every ...
0
votes
1
answer
90
views
Issue with Chrome not Utilizing Cache for .NET Project I'm encountering a puzzling behavior
Chrome seems to be ignoring cache directives for certain static files. Here's the relevant excerpt from my web.config as i use IIS:
...
0
votes
1
answer
330
views
Why is an HTTP response with Cache-Control: public, max-age=86400 not being cached by Cloudflare?
Our server (origin server) is sending the following HTTP response back to Cloudflare, including "Cache-Control: public, max-age=86400", expecting Cloudflare to cache it:
HTTP/2 200
date: Tue,...
0
votes
1
answer
1k
views
How does CloudFront behave if no Cache-Control header is set on the origin response?
I have an origin which doesn't set Cache-Control headers in its response. It appears as if those responses are not being cached by CloudFront (I never see an ...
11
votes
2
answers
660
views
Cache-Control: I don't understand `must-understand`
I don't understand the must-understand directive of the HTTP Cache-Control header. What are some examples of when this would be ...
2
votes
0
answers
499
views
Non-Cached Data Being Served as Cached Data in Front Door
I have a Front Door / CDN with caching enabled that uses the response from an API Management service to determine what specific content to cache.
The API Management service has a set of endpoints, the ...
0
votes
0
answers
186
views
Cache busting Angular
My App Service is correctly updated. But i dont see the UI from the first enter.
I use Angular and Azure App Service for this.
If i put F5(without Ctrl) it reloads and gives me the right view of UI.
...
1
vote
0
answers
112
views
Privacy: API MediaDevices.getUserMedia() and Cache-control: private
For an experimental website/pwa, I'm using the user's camera stream with MediaDevices.getUserMedia() as background with this:
...