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
1
vote
1 answer

Safari uses stale copy of a file

I have a javascript file which is frequently updated on the server (every hour). It is a plugin used in websites by the website's users. It is served millions time a day. In order for users to get the latest copy I use a header with: cache-control:…
Dani Magen
  • 329
  • 3
  • 12
1
vote
1 answer

How to set Access-Control-Max-Age for flask_cors?

In my flask application, I need to set Access-Control-Max-Age. What is the correct syntax for it? from flask import Flask, send_from_directory from flask_cors import CORS, cross_origin app = Flask(__name__,static_folder='./build')…
DragonKnight
  • 1,740
  • 2
  • 22
  • 35
1
vote
1 answer

Client keeps requesting assets event though Cache-Control havent expired

I have a simple Node server which sets the Cache-Control max-age to 1200seconds and the client requests an image. Even though the 1200 seconds havent passed, if i change the image from server and refresh the page, the image will be downloaded again…
George Paouris
  • 525
  • 4
  • 16
1
vote
1 answer

Does max-age update automatically if a conditional header returns 304?

Imagine a resource with a max-age of 60 seconds: After 1 minute, the browser sends a conditional header If-None-Match This checks if the etag of the resource has changed. If the etag has not changed, the server will return a 304 Not Modified…
TomDane
  • 1,010
  • 10
  • 25
0
votes
0 answers

Activated AWS CDN - Keep receiving "X-Cache: Miss from cloudfront"

I just activated AWS CDN, and all I see is "X-Cache: Miss from cloudfront". Also I see "max-age=0" which I don't know where it's coming from. Checking the code (cakePhP), I don't see any place setting max-age. I wonder that's the reason? Here is the…
shabk
  • 51
  • 1
  • 9
0
votes
0 answers

Add cache_control and etag in django class based view

I have a django api which returns response like the image path and image location along with city id. I have also added cache_control in the response header to cache the images on the client side. Now I want the api to check the city id after the…
0
votes
0 answers

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. A more compatible way to revalidate, if I…
0
votes
0 answers

Make cookie secure

Need to add max-age to document.cookie = "up=upv; SameSite=None; Secure"; IE document.cookie = "up=upv;max-age=" + (60*60*24*30) + ";" document.cookie = "up=upv;max-age=" + (60*60*24*30) + ";"
0
votes
1 answer

Supabase cache max-age not being respected by Chrome

I have updated the cache max age for my images in Supabase to 15552000 seconds (6 months), since my files will be static. However, when I check the network tab in Chrome, the max-age is still 3600. I have made sure that it was not because it was the…
MIPB
  • 1,770
  • 2
  • 12
  • 21
0
votes
1 answer

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 updated correctly using another gsutils command: gsutil stat…
0
votes
1 answer

Add Max-age to Big Commerce CDN Images

I am currently running performance testing on my sites, all of which are hosted through Big Commerce (cornerstone theme, stencil). I am using webpagetest.org, and under the performance section, there is a metric "Leverage browser caching of static…
0
votes
1 answer

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 no longer valid after 10 seconds and client has to…
Nitul
  • 997
  • 12
  • 35
0
votes
0 answers

ASP.NET Core 3.1 Session MaxAge is not working

services.AddSession(options => { options.Cookie.HttpOnly = true; options.Cookie.MaxAge = TimeSpan.FromDays(365) <--- 1 year; options.Cookie.IsEssential = true; }); app.UseSession(); in Startup.cs enter image description here But, after 30…
0
votes
0 answers

how to implement .htaccess file in angular project with no backend

I need help regarding implementing the .htaccess file in my angular project which doesn't have the backend integration yet at all. That is why I can't make http headers to send the 'Cache-Control' header as i want it to. Like currently I'm working…
Shoaib Khalil
  • 1,874
  • 17
  • 10
-1
votes
1 answer

Setting custom Google Storage Bucket wide max-age header

Respected Seniors, I am using google storage bucket to store the static content of my website. I wanted this content to be cached in CDN, that is why I have made the bucket public, which results in setting https headers Cache-control to public and…