LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > [RESOLVED] Expires Headers for images in stylesheets

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2010, 12:31 PM
ideaoforder ideaoforder is offline
Member
 
Join Date: Jul 2008
Posts: 28
Default [RESOLVED] Expires Headers for images in stylesheets

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!
Reply With Quote
  #2  
Old 03-01-2010, 01:24 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
check the MIME type of ".png", it should be in "Expires By Type" configuration

http://www.litespeedtech.com/docs/we...#expiresByType
Reply With Quote
  #3  
Old 03-01-2010, 01:34 PM
ideaoforder ideaoforder is offline
Member
 
Join Date: Jul 2008
Posts: 28
Default 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.
Reply With Quote
  #4  
Old 03-01-2010, 01:36 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
what is in the response header when you access the file directly? check from firebug.
Reply With Quote
  #5  
Old 03-01-2010, 01:40 PM
ideaoforder ideaoforder is offline
Member
 
Join Date: Jul 2008
Posts: 28
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
Reply With Quote
  #6  
Old 03-01-2010, 02:02 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
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.
Reply With Quote
  #7  
Old 03-01-2010, 02:16 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Quote:
Originally Posted by ideaoforder View Post
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.
Reply With Quote
  #8  
Old 03-03-2010, 07:54 AM
ideaoforder ideaoforder is offline
Member
 
Join Date: Jul 2008
Posts: 28
Default 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.
Reply With Quote
Reply

Tags
caching, expires, rails

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:24 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.