[RESOLVED] Expires Headers for images in stylesheets

#1
Hello, I have expires headers enabled with the default settings in a Rails app. Everything is working as expected, except for images loaded from stylesheets (i.e. style.css > background: url(/images/something.png);). These don't get expires headers and thus aren't getting cached.

Is there a setting I have to change to get add expires headers to these as well?

Thanks!
 
#3
Just Stylesheets

I currently have:

image/*=A604800, text/css=A604800, application/x-javascript=A604800

which should cover pngs. All images embedded in the html have proper expires headers--it's just the ones in the stylesheet that seem to have a problem.
 
#5
Last-Modified Mon, 01 Mar 2010 17:51:42 GMT
Content-Type image/png
Content-Length 7350
Date Mon, 01 Mar 2010 21:39:01 GMT
Server LiteSpeed
 

mistwang

LiteSpeed Staff
#6
If you access it again by hitting enter from browser address bar, not using refresh, will you get 304 response?

I wonder if the request was served by rails dynamically.
 

mistwang

LiteSpeed Staff
#7
I currently have:

image/*=A604800, text/css=A604800, application/x-javascript=A604800

which should cover pngs. All images embedded in the html have proper expires headers--it's just the ones in the stylesheet that seem to have a problem.
You can also try add "image/png=A604800" explicitly, it does not hurt anything.
 
#8
You were right

Excellent call! The images in question were being served by Rails dynamically--in this case because of an overzealous rewrite rule. Thanks so much! I don't know that I would have caught that.
 
Top