Questions tagged [max-age]

Related to the max-age property in HTTP. The Access-Control-Max-Age response header indicates how long the results of a preflight request (that is the information contained in the Access-Control-Allow-Methods and Access-Control-Allow-Headers headers) can be cached.

31 questions
8
votes
2 answers

Can a user agent set a max-age greater than zero in its request?

I have a doubt about max-age behaviour after reading the Http Cache rfc. Scenario: User agent GET /foo Origin Server Response header cache-control: max-age=120 Server tells user agent that the resource requested should be revalidated after 2…
systempuntoout
  • 71,966
  • 47
  • 171
  • 241
7
votes
2 answers

How to know if resource was truly loaded from cache in chrome devtools?

Chrome devtools network tab shows "Transferred data over network" value of the same size of cached resource file. If I block the last request that appears on above image, picture isn't loaded, but the second request still shows the same amount of…
5
votes
1 answer

Golang Cookie Max-Age vs Expire

What is differencies between Expires and Max-Age in Cookie struct ? I cannot understand. type Cookie struct { Name string Value string Path string // optional Domain string // optional Expires time.Time //…
SabuhiGurbani
  • 91
  • 1
  • 6
4
votes
1 answer

mozilla firefox ignoring the cache-control header

I am loading a few thumbnail images in my application which are stored on google cloud, I have made the thumbnail objects public and set cache-control: public, max-age:2628000, this seems to be working on chrome where i see the images are getting…
opensource-developer
  • 2,826
  • 4
  • 38
  • 88
4
votes
1 answer

What will happen if Cache-Control have `no-cache` and `max-age=900`?

What'll happen if I set server response as: Cache-Control: private,no-cache,max-age=900? What'll happen if the header is like: Cache-Control: public,no-cache,max-age=900? Since it has a no-cache whether browser (Or proxy server) consider the…
Asim K T
  • 16,864
  • 10
  • 77
  • 99
4
votes
1 answer

Image caching best practice for unique identifier

I am trying to build an app where I download a list of images from different URLs into a collection view. All these images are stored inside a cache with max age and cache limit. I am storing the URL as the key for each image so that I can check if…
Nelly v
  • 229
  • 1
  • 12
4
votes
2 answers

What is the difference between max-age=0 and max-age=-1 in Cache Control?

What's the difference in browser behavior between two headers Cache-control: max-age=0 and Cache-control: max-age=-1? If the browser receives max-age=0, it will revalidate cache immediately. If the browser receives max-age=10, it will revalidate…
3
votes
1 answer

Axios GET requests ignoring response Cache-Control max-age

I've configured my server responses to include Cache-Control: max-age= on several endpoints. I'm using Axios on the front end to make AJAX requests on these endpoints. When I refresh the page a few requests are properly pulled from the…
wrkyle
  • 529
  • 1
  • 13
  • 36
3
votes
1 answer

Caching in HTTP requests: ETag vs max-age

I have a SPA which consumes some static assets from the backend server. For reasons, I picked ETag validation as the caching mechanism. In short, I want the browser keep the assets in its cache forever, as long as the related ETags remain…
Hans
  • 2,674
  • 4
  • 25
  • 48
2
votes
1 answer

Does it make sense to set Cache-Control max-age=0 and s-maxage= not zero?

Somebody commented on this question about caching: ...using a Cache-Control value of: max-age=0, s-maxage=604800 seems to get my desired behavior of instant client updates on new page contents, but still caching at the CDN level Will I really get…
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
2
votes
0 answers

cant update css on server. showing max-age=14400.how to overwrite disable htaccess

here is my htaccess code Header set Cache-Control "no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires 0 and what i see on browser even clearing browser history
2
votes
1 answer

Requests not being made from android app, with max-age set

I have an api that returns an object as the response, and an etag and max age as headers. The response looks like this: HEADERS: 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', …
Lazarus Rising
  • 2,597
  • 7
  • 33
  • 58
1
vote
1 answer

Why does Google Chrome not honor the caching headers?

This is the header that I send back to my users. It's taken from the Chrome DevTools: When I close the DevTools and refresh the page, I still get requests for this image in my servers. Here it's claimed that Google does not honor cache when we…
Big boy
  • 1,113
  • 2
  • 8
  • 23
1
vote
1 answer

Is it true that any time duration longer than 1 year of HTTP res header directive `Cache-Control max-age` consider invalid

I came cross a case where the Cache-Control: public, max-age=31622400, immutable which make 366 days, however it seems the best practice to be not greater than 31536000 which makes it 365 days, my question is, is the max-age considered invalid date…
Yusuf
  • 2,295
  • 7
  • 15
  • 34
1
vote
0 answers

Extending lifetime of affinity cookie per request

We´re using an haproxy ingress in our kuberntes cluster with cookie affinity for sticky session handling. The ingress configuration like this: ingress.kubernetes.io/affinity: cookie ingress.kubernetes.io/session-cookie-keywords: indirect nocache…
1
2 3