Questions tagged [cache-control]

The HTTP `Cache-Control` header specifies directives which override default HTTP caching behaviour.

The HTTP Cache-Control header specifies directives which override default HTTP caching behaviour.

Resources:

1297 questions
665
votes
8 answers

What's the difference between Cache-Control: max-age=0 and no-cache?

The header Cache-Control: max-age=0 implies that the content is considered stale (and must be re-fetched) immediately, which is in effect the same thing as Cache-Control: no-cache.
rubyruy
  • 7,101
  • 3
  • 16
  • 15
209
votes
5 answers

What is the difference between HTTP status code 200 (cache) vs status code 304?

I'm using the Google "Page Speed" plug-in for Firefox to access my web site. Some of the components on my page is indicated as HTTP status: 200 200 (cache) 304 By Google's "Page Speed". What I'm confused about is the difference between 200 (cache)…
Hank
  • 2,111
  • 2
  • 13
  • 6
195
votes
5 answers

Difference between no-cache and must-revalidate

From the RFC 2616 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1 no-cache If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful…
Luke Puplett
  • 36,042
  • 37
  • 161
  • 231
191
votes
7 answers

what’s the difference between Expires and Cache-Control headers?

What’s the difference between Expires and Cache-Control headers?
whiterose
  • 3,871
  • 7
  • 22
  • 18
179
votes
19 answers

Cached, PHP generated Thumbnails load slowly

Question Part A ▉ (100 bountys, awarded) Main question was how to make this site, load faster. First we needed to read these waterfalls. Thanks all for your suggestions on the waterfall readout analysis. Evident from the various waterfall graphs…
Sam
  • 15,156
  • 23
  • 85
  • 134
156
votes
4 answers

What is Cache-Control: private?

When I visit chesseng.herokuapp.com I get a response header that looks like Cache-Control:private Connection:keep-alive Content-Encoding:gzip Content-Type:text/css Date:Tue, 16 Oct 2012 06:37:53 GMT Last-Modified:Tue, 16 Oct 2012 03:13:38…
user782220
  • 9,199
  • 16
  • 64
  • 127
142
votes
2 answers

Is it fine if first response is private with AppCache (Symfony2)?

I'm trying to use http caching. In my controller I'm setting a response as follows: $response->setPublic(); $response->setMaxAge(120); $response->setSharedMaxAge(120); $response->setLastModified($lastModifiedAt); dev mode In dev environment first…
Jakub Zalas
  • 33,992
  • 9
  • 84
  • 118
137
votes
1 answer

Private vs Public in Cache-Control

Can you please describe an example indicating difference between Public and Private Cache-Control in asp.net applications hosted in IIS. I read in MSDN that the difference is the following: Public: Sets Cache-Control: public to specify that the…
ppolyzos
  • 6,146
  • 6
  • 26
  • 39
134
votes
6 answers

How to prevent Browser cache for php site

I have a php site running in cloud server.When ever i add new files css, js or images the browser is loading the same old js, css and image files stored in cache. My site has a doctype and meta tag as below
ArrayOutOfBound
  • 2,424
  • 4
  • 18
  • 24
121
votes
6 answers

How to prevent Browser cache on Angular 2 site?

We're currently working on a new project with regular updates that's being used daily by one of our clients. This project is being developed using angular 2 and we're facing cache issues, that is our clients are not seeing the latest changes on…
Rikku121
  • 2,171
  • 2
  • 19
  • 34
85
votes
3 answers

Max value for cache control header in HTTP

I'm using Amazon S3 to serve static assets for my website. I want to have browsers cache these assets for as long as possible. What meta-data headers should I include with my assets Cache-Control: max-age=???
Casey Flynn
  • 12,592
  • 20
  • 99
  • 189
73
votes
3 answers

HTTP Cache Control max-age, must-revalidate

I have a couple of queries related to Cache-Control. If I specify Cache-Control max-age=3600, must-revalidate for a static html/js/images/css file, with Last Modified Header defined in HTTP header: Does browser/proxy cache(like Squid/Akamai) go…
nyb
  • 731
  • 1
  • 5
  • 3
72
votes
8 answers

Caching effect on CORS: No 'Access-Control-Allow-Origin' header is present on the requested resource

The short version of this issue is we are seeing the typical CORS error (x has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.) however we are absolutely sending the specified headers. The…
Chris Pearce
  • 1,396
  • 3
  • 11
  • 18
50
votes
1 answer

how does a etag work in expressjs

Expressjs automatically send etags. I would like to know how the etag is generated..is it based on the content that is generated dynamically by the get routine. or is there way I can mainpulate it, by not even going through the process of generating…
coool
  • 7,725
  • 12
  • 50
  • 77
48
votes
3 answers

Expires vs max-age, which one takes priority if both are declared in a HTTP response?

If a HTTP response that returns both Expires and max-age indications which one is used? Cache-Control: max-age=3600 Expires: Tue, 15 May 2008 07:19:00 GMT Considering that each one refers to a different point in time.
vtortola
  • 32,045
  • 25
  • 144
  • 246
1
2 3
86 87