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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > LiteSpeed Cache > Cache not working with cPanel

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2012, 01:58 AM
genious genious is offline
New Member
 
Join Date: Mar 2012
Posts: 6
Default Cache not working with cPanel

Hello,

I need some help over here if you don't mind.

I'm having a hard time enabling LiteSpeed Caching, as I have purchased the 2-CPU license just to use this feature, if you can shed some light over here:

I have set the following rules on .htaccess

RewriteEngine on
# cache for 2 mins for php pages only
RewriteRule /(.*\.php)?$ - [L,E=Cache-Control:max-age=120]

And of course in LS control panel:

Enable Cache:No
Cache Request with Query String:Yes
Cache Request with Cookie:No
Cache Response with Cookie:No
Ignore Request Cache-Control:No

Ignore Response Cache-Control:No
Enable Private Cache: Yes*
Private Cache Expire Time (seconds): 120

I know that this has to do with:

3. For imported Apache vhost:

Cache can be turned on/off with "CacheEnable" , "CacheDisable" directives in Apache config file. Nothing needs to be done for the cache policy. It will assume the same default settings at LSWS Server level. Rewrite rules can be placed in httpd.conf or in-directory .htaccess file as shown in step 5 below.
Note: Apache mod_cache directives CacheIgnoreCacheControl, CacheMaxExpire also can be used in the Apache config file as well as .htaccess to fine tune cache policy.

but I don't understand exactly what we should do, I have recompiled Apache with Cache Module. What else?

Please note that I'm using an imported httpd.conf, as I was running cPanel + Apache and switched to LiteSpeed.

Thank you
Reply With Quote
  #2  
Old 03-10-2012, 07:03 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
please try:

Enable Cache:No
Cache Request with Query String:Yes
Cache Request with Cookie:Yes
Cache Response with Cookie:Yes
Ignore Request Cache-Control:Yes

Ignore Response Cache-Control:Yes
Enable Private Cache: No*
Private Cache Expire Time (seconds): 120

>I have recompiled Apache with Cache Module.
not necessary

then test on one simple .php first, say phpinfo.php
Reply With Quote
  #3  
Old 03-10-2012, 11:22 AM
genious genious is offline
New Member
 
Join Date: Mar 2012
Posts: 6
weird :s still nothing!!

root@server1 [/home/casafree/www/test]# pwd
/home/casafree/www/test
root@server1 [/home/casafree/www/test]# cat .htaccess
RewriteEngine on
# cache for 2 mins for php pages only
RewriteRule /(.*\.php)?$ - [L,E=Cache-Control:max-age=120]
root@server1 [/home/casafree/www/test]#

www.casafree.com/test/info.php

Cache Storage Settings Edit
Storage Path /diskcache/
Max Object Size 1024
Cache Policy

Enable Cache No
Cache Expire Time (seconds) 120
Cache Request with Query String Yes
Cache Request with Cookie Yes
Cache Response with Cookie Yes
Ignore Request Cache-Control Yes
Ignore Response Cache-Control Yes
Enable Private Cache No
Private Cache Expire Time (seconds) 120

Thanks
Reply With Quote
  #4  
Old 03-10-2012, 07:17 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
Quote:
Max Object Size 1024
this means 1024 bytes, too small. change it to 100k or leave it blank, the default size is 128k.

to ensure /diskcache exists and writable for user which run litespeed(nobody for example)
Reply With Quote
  #5  
Old 03-11-2012, 01:16 AM
genious genious is offline
New Member
 
Join Date: Mar 2012
Posts: 6
Haaaa! it does work now! but for exemple the main page isn't cached, just the inner pages ( some of them ). although in my settings, everything is set to Yes.

http://www.casafree.com/

I only have these:

RewriteEngine on
RewriteRule /(.*\.php)?$ - [L,E=Cache-Control:max-age=120]

Thanks
Reply With Quote
  #6  
Old 03-11-2012, 05:14 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
but I did tests on
www.casafree.com/test/info.php
looks like not cached.

try following slightly modified rewriterule:
RewriteEngine on
RewriteRule (.*\.php)?$ - [L,E=Cache-Control:max-age=120]
Reply With Quote
Reply

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 02:20 AM.



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