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

Go Back   LiteSpeed Support Forums > External Applications > Apache Migration/Compatibility > htaccess Cache-Control ignored

Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2013, 02:18 PM
Mahks Mahks is offline
New Member
 
Join Date: Jan 2013
Posts: 1
Default htaccess Cache-Control ignored

The following directive is in htaccess in domain/cached, it works in apache but seems to be ignored in litespeed.

<FilesMatch "\.(php)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>

When placed in the domain directory htaccess, it is applied, but then it is applied to all sub-directories.

What is the difference between litespeed & apache for this?

Edit:
I have been told by my hosting service that litespeed does not support htaccess in sub-folders.
Is this true? How do you set caching for different directories?

Last edited by Mahks; 01-17-2013 at 02:16 PM..
Reply With Quote
  #2  
Old 02-11-2013, 01:09 PM
dgtl dgtl is offline
New Member
 
Join Date: Feb 2013
Posts: 8
I don't think this is true. I have LSWS 4.2.1 and .htaccess in sub directories work just fine.
Reply With Quote
  #3  
Old 02-11-2013, 06:21 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
Quote:
I have been told by my hosting service that litespeed does not support htaccess in sub-folders. Is this true?
not true. you can test it easily.

Quote:
When placed in the domain directory htaccess, it is applied, but then it is applied to all sub-directories.
just to confirm, what's the lsws version?
Reply With Quote
  #4  
Old 02-11-2013, 11:59 PM
Monarobase Monarobase is offline
Senior Member
 
Join Date: Jan 2013
Posts: 95
I don't know if this is the normal behaviour but the following should work :

Quote:
<FilesMatch "\.(php)$">
Header set Cache-Control "max-age=31536000"
</FilesMatch>
From my tests when you specify both cache type and cache age litespeed ignores the Cache-Control setting. In litespeed's docs they either set it to max-age=xxx or to private.

Edit : I don't think the above will work either (at least not on LS 4.2.1) try to update to LS 4.2.2 and see if this helps…

Last edited by Monarobase; 02-14-2013 at 12:45 AM..
Reply With Quote
Reply

Tags
cache-control, htaccess

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 01:04 PM.



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