Questions tagged [cache-control]
The HTTP `Cache-Control` header specifies directives which override default HTTP caching behaviour.
1,390
questions
0
votes
0
answers
10
views
What is the difference between using If-None-Match header and using Cache-Control: no-cache?
My understanding of Cache-Control: no-cache is that it always asks the server to validate the cache.
I understand that "ETag" is used for validation in this case, how is this different from ...
0
votes
0
answers
24
views
Does Cloudflare cache redirect location (URL) or response from redirect location?
I wonder how Cloudflare caching works and behaves with redirection. I don't seem to find documentation regarding that but let me know if I missed it.
Suppose I redirect a user from location https://...
-1
votes
2
answers
47
views
How does one exclude a single image, or a set of images from a cache control policy? [closed]
I'm looking to set a cache control policy on some of the images on my website to appease the Google lords, however I don't want all the images on my website to be cached. While I'm a bit fuzzy on how ...
0
votes
0
answers
51
views
caching authorized content in microsoft CDN
I have a web service and microsoft CDN on top of it. I am using bearer token to gain access to the service.
When I call service directly I get a header back:
Cache-Control: public,max-age=6000
but ...
0
votes
1
answer
94
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 ...
0
votes
0
answers
8
views
Clean custom cache key after cache flush
I am trying to cache the contents of a controller response, in the controller I setup a unique cache key and if the key does not exist it is store in cache and servers non cache result, next time the ...
0
votes
0
answers
91
views
Need Help on Next.JS and Safari Browser Cache Problem
Problem detail: I've been troubled with this issue for a week til now. I've also posted on github but no one answered. https://github.com/vercel/next.js/issues/45937
This is a bug with getStaticProps ...
0
votes
0
answers
100
views
CDN does not return cached response
I have a function app running in azure and I have wrapped the response to be returned as httpResponseMessage:
public static HttpResponseMessage CreateOkRequestMessageResponse(
this ...
0
votes
2
answers
58
views
AWS Cloudfront. Force browser to revalidate but not CDN
I have a file named sdk.js. This file name is not versioned or hashed in any way because we don't control the sites where it is embedded so the name must remain consistent.
The browser should cache ...
0
votes
1
answer
50
views
How to clear cached versions of website on users Browsers?
I have a very simple HTML/CSS/JS website. When ever I make changes to it, to see the updated version I have to manually clear my cache on mobile or hard reload on PC.
Is there a way of clearing cache ...
0
votes
0
answers
16
views
Can the Cache-Control header be set per device type? (mobile / server)
For fast page load speed, I need to cache the http response of my website using the Cache-Control header that I set to "s-maxage=60, stale-while-revalidate=7200".
Now, this causes an issue ...
0
votes
1
answer
84
views
exclude specific css file on Google Cloud CDN
Is a WordPress setup. I need to work on a css stylesheet but the changes do not reflect immediately. It will sometime reload the previous version too. How can I exclude a specific css file from ...
0
votes
1
answer
31
views
How can I benefit from cache when one element is effected by specific user situation
We have a page that lists products for an e-commerce platform, which updates every 30 minutes and we cache it for 30 minutes as it gets a lot of views.
However there is a "buy" button on it, ...
0
votes
1
answer
53
views
Browser sending old "Authorization" header for subsequent requests
We are experiencing an issue with Browser sending Authorization header of initial request for subsequent requests to the same requestURI.
Problem:
We have a webproject which has user specific business ...
0
votes
0
answers
125
views
Browser loads response from cache although no-cache header is set
I'm working on a web app and I'm having the following problem:
When I go on some page my server sends a response with cache-control: no-cache header.
Then I do some changes (graphql mutations) on ...
0
votes
0
answers
45
views
Response caching not working in apache ubuntu
I am trying to cache all static files (any extension) ignoring any Cache-Control rules/headers. However, I always see X-Cache: MISS from 127.0.1.1 on the browser. Also the files are not getting cached ...
0
votes
1
answer
109
views
Unable To Update Image On Google Cloud Storage via API
I am trying to overwrite an image in my Cloud Storage over the Python API, but after I overwrite it and refresh (and delete browsercache) the Cloud Webpage or the public link the image is still the ...
0
votes
1
answer
55
views
Pre-cache List of videos uisng CacheDataSource.Factory( ) android
I'm able to cache a playing video using the below code:
ProgressiveMediaSource mediaSource = new ProgressiveMediaSource.Factory(
new CacheDataSource.Factory()
....
1
vote
0
answers
129
views
Title: Angular - Images and icons disappear from the page after change detection is triggered
Problem Statement:
I have an Angular(v12) webpage with several images and icons. These images are either svg, png or icons imported by the ngb library. When the page loads initially, all the icons and ...
0
votes
1
answer
91
views
Setting Cache-Control metadata via gsutils does not update response headers
When setting the cache-control metadata key via the gsutils command:
gsutil -m setmeta -h "Cache-Control:public, max-age=14400" 'gs://my-bucket/style.css'
I verify that the metadata is ...
0
votes
0
answers
76
views
node express setting Cache-Control header on res multiple times (or can we check if is header already set)
I would like to set up my node express app so that, by default, responses are not cached... i.e. set this explicitly on the response rather than just leave it to chance.
But for a small number of the ...
0
votes
0
answers
139
views
Why does SWR in a loader not block the page load when caching with CDN compared to browser cache?
This is my loader and header functions:
export async function loader() {
const expenses = [
{
id: '637f853a8517a37d05c402b5',
title: 'first expense',
amount: 234,
},
];
...
0
votes
0
answers
37
views
How to clean browsers cache for my website for all visitors to snow updated output?
I am a web developer and working on different websites. Some websites are live (url: http://www.example.com) & some are on staging (url: http://demo.example.com) domain (during development).
When ...
0
votes
2
answers
66
views
Why isn't ContentSettings cache_control max-age being honored in Azure storage blob via Python?
I can't seem to activate Cache-Control max-age in an Azure storage blob in Python via the following code:
contentSettings = ContentSettings(cache_control="max-age=86400")
containerClient....
0
votes
1
answer
231
views
cache-control headers with last-modified in the past
I get the following header on CURL request.
Am I correct to assume that because the last-modified is that back in the past - the request is not cached in the browser?
➜ curl -I https://dommain.com/...
0
votes
0
answers
7
views
Every time my website loads I want it to first clear the local cache. How in HTML?
I have my two name logos coming in from the right using marquee and stopping exactly where I want (within the and ). When pressing Ctrl + F5 it works perfectly. When pressing F5 only, the images ...
0
votes
0
answers
156
views
Configure the Cache-Control header from within an Angular Universal application
I am writing an Angular Universal application hosted behind an express.js server. I would like to manage the Cache-Control header set by express.js on a per-route basis: some of my pages are generated ...
1
vote
1
answer
121
views
How we can get the updated data by refreshing the cache using the cache_page in DRF with the same route?
The website is similar in functionality to Twitter and we're using a Django caching mechanism for the feed but when the user created his post he is not able to find his post for the next 10 minutes ...
0
votes
1
answer
233
views
Google Cloud Storage cache-control directive not working
I have a private bucket, but I want to override the metadata for the Cache-Control directive to be public. In the dashboard I have added public, max-age=31536000 to the metadata of my object.
Upon ...
0
votes
1
answer
105
views
Are "max-age" and "no-cache" from "Cache-Control" header mutually exclusive?
Do "max-age" with a positive value and "no-cache" make sense?
The documentation doesn't mention whether they are mutually exclusive https://developer.mozilla.org/en-US/docs/Web/...
2
votes
1
answer
1k
views
Cache-Control policy for external Next.js Image coming from AWS CloudFront is not efficient for Google Lighthouse
I'm trying to optimize my Next.js app by fixing all the issues reported by Google Lighthouse.
One of the most important pitfalls it has right now regards to images:
As per the documentation, Next.js ...
1
vote
0
answers
179
views
Blazor client-side - DLLs not cached
I created a simple Blazor app using the WebAssembly approach in .NET 6.
However, every-time I visit the website, it takes several seconds to load. About 8.5MB of data and over 50 files, most of which ...
0
votes
0
answers
54
views
Why are my static files not beeing cached properly?
I have a little problem caching my static files in a Laravel/Nginx environment.
I know that the static files are not beeing cached properly because the google pagespeed is telling me so and also other ...
0
votes
0
answers
52
views
Missing Cache-Control header in my java spring mvc web app
i cant get cache control header when i inspect my web page
have tried this but didn't worked
<headers defaults-disable="true">
<cache-control />
</headers>
0
votes
0
answers
23
views
the difference between max-age header in response and in request
I need to know what should happen when set different value to request max-age and response max-age for example
in server response: res.setHeader("Cache-Control", "max-age=3600")
in ...
2
votes
2
answers
66
views
How to stop browser from caching web pages
I know this question has been asked many times and I've implemented what I've found online, but it doesn't seem to work.
The background: I'm generating html pages from Python (not using any libraries ...
0
votes
1
answer
80
views
Modify logic of what to do when cache is full in Retrofit/OkHttp?
I am trying to define my own logic of how is cache handled when it is full, because actual behavior is not wanted. I do not know if it is possible (I have not found any documentation on this topic), ...
0
votes
0
answers
70
views
Overriding Cache-Control header in IIS
In one of our penetration test we found the cache-control in response header is being passed as private, though we need "no-cache, no-store".
It seems private is the default setting for the ...
0
votes
0
answers
122
views
How can I allow only selected Lambdas to invalidate the API-Gateway Cache
I’m using an AWS API-Gateway with a lambda as the endpoint to write data into a dynamoDB table. Another lambda which is invoked from the same API (different resource) returns this data. I have enabled ...
0
votes
0
answers
31
views
How to set Cache-Control header in Nodemailer
I am trying to set the Cache-Control header in Nodemailer,
like this:
let info = await transporter.sendMail({
from: senderAddress,
to: email,
subject: subject,
html: html,
headers: {
&...
0
votes
0
answers
45
views
Implementing Logout functionality in JEE webapp using Cache-Control
I am trying to implement Logout functionality in my JEE application. On the visual side user seems to logout of the application and the session gets destroyed, but the problem is that user can ...
0
votes
0
answers
21
views
How to make sure newly deployed web page is being used and not previously cached one
I am in a position where a web page version of mine has been deployed that I specifically said shouldnt be due to a serious bug in one of the js files, despite having deployed the fixed version the ...
0
votes
0
answers
67
views
How to reduce browser cache Size when developing Flutter Web App
I'm currently creating a Flutter website and I don't quite understand why the browser cache file has a size of about 8.5 MB, although I've only uploaded and use images with a total size of 1.4 MB.
...
1
vote
1
answer
207
views
Does NextJS on demand revalidation works for Next/link?
https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration#on-demand-revalidation
From NextJS docs, it seems that on demand cache revalidation should work fine with regular &...
0
votes
1
answer
88
views
Azure Media Player - cache-control
I'm using Azure Media Player for video playback and that works great. However, the media player css/js/wof files do not have any cache-control headers set. They come from the amp cdn (amp.azure.net). ...
0
votes
0
answers
59
views
Why is ExpiresDefault taking precedence over ExpiresByDefault
I am running an ElasticBeanstalk instance running apache.
I have the following file in .platform/httpd/conf.d which should set my cache policy.
<IfModule mod_expires.c>
ExpiresActive on
...
0
votes
0
answers
207
views
Apache mod_cache_disk and AH00717: Premature end of cache headers
I'm using apache-2.4.53 and having problems with caching. Perodically I see errors related to "premature end of cache headers" and don't know how to troubleshoot it. This is on fedora34. The ...
0
votes
0
answers
407
views
How to add Cache-Control header in Nginx for a specific folder and every file and folder beneath it?
I want to disable all caching for a specific folder and all it's descendants in my application. The folder has some files in the root and also other subdirectories.
printscreen of my folder in ...
0
votes
0
answers
121
views
Will IIS cache the file if the response header of that particular file has 'cache-control: private'?
Since I'm unable to access the IIS, wanted to check the below point:
Will IIS cache the file, if the response header of that particular file has 'cache-control: private' ? (set at the code level)
...
0
votes
0
answers
50
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 ...