I am using a controller to serve up CSS. I am having a problem with
browsers not caching the CSS and think it is related to the Cache-
Control header. I tried the following, but the browsers still will
not cache:
1) do you have caching disabled (sorry but tech support always has to
know if the computers plugged in).
2) If in firefox you go to Tools/page_info what are the values of:
Thanks so much for looking into this with me! I'm getting desperate.
2 questions:
1) do you have caching disabled (sorry but tech support always has to
know if the computers plugged in).
Yes, and have a used all browsers with the same the results.
2) If in firefox you go to Tools/page_info what are the values of:
All of the results are taken from looking at the information on the
css being linked on the page using the following link:
<link href="/css/colorpicker.css" media="screen" rel="stylesheet"
type="text/css" />
The following results are using the Rails default headers:
Cache Source: Disk cache
Expires: Not specified
Meta: [nothing]
Also, the response headers (according to the web developer plugin):
Status: 304 Not Modified
X-Runtime: 0.08278
Etag: "aeafc040943fac69eb986a0f90e79063"
Cache-Control: private, max-age=0, must-revalidate
Server: Mongrel 1.0.1
Content-Type: text/css; charset=utf-8
Content-Length: 2452
200 OK
The following results are after I have switched the headers['Cache-
Control'] to 'public':
Cache Source: Disk cache
Expires: Not specified
Meta: [nothing]
Also, the response headers (according to the web developer plugin):
Status: 304 Not Modified
X-Runtime: 0.08174
Etag: "aeafc040943fac69eb986a0f90e79063"
Cache-Control: public
Server: Mongrel 1.0.1
Content-Type: text/css; charset=utf-8
Content-Length: 2452
200 OK
I'm having the same problem. I'm working on an app and deploying to a
development server and I noticed recently that css background images are
being reloaded on every page request. At first I thought it was my
browser but then I checked the headers and I find that they're not
allowing caching:
I'm not sure whether to change the Rails config or the Ngninx server
config? Which would be correct? I'm not sure where this header is being
set so I don't know where to tackle the problem.