Cache not working with cPanel

Discussion in 'LiteSpeed Cache' started by genious, Mar 10, 2012.

  1. genious

    genious New Member

    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
  2. NiteWave

    NiteWave Administrator

    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
  3. genious

    genious New Member

    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
  4. NiteWave

    NiteWave Administrator

    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)
  5. genious

    genious New Member

    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
  6. NiteWave

    NiteWave Administrator

    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]

Share This Page