[solved] Did something change in 4.2.7-4.2.9? Cache stopped working

Discussion in 'LiteSpeed Cache General' started by ms_services, Apr 10, 2014.

  1. ms_services

    ms_services Member

    Our cache stopped functioning properly.
    We're using cache for vbulletin+vbseo. Also, using litespeed Enterprise. We had to revert back to 4.2.6

    Users were seeing cached pages. Complaining about not seeing new posts, have to hard refresh. Pages that weren't supposed to be cached were being cached, like the login & logout pages.

    Our setup is pretty simple, if pages are viewed by guests, they are cached to 240 seconds. If members, then not cached at all.

    ## Here is excerpt of .htaccess cache routine
    // here is where we say don't cache if user that is logged in
    // here is where we set cookie for users that are logged in
    //Here are server settings for cache
    Last edited: Apr 10, 2014
  2. NiteWave

    NiteWave Administrator

    not sure any change from 4.2.6 to 4.2.7+
    for above settings, I's suggest a few changes:
    RewriteRule ^(.*)?$ - [L,E=Cache-Control:max-age=240]
    RewriteRule ^(.*)?$ - [E=Cache-Control:max-age=240]
    (i.e., remove "L")

    Ignore Request Cache-Control: No -> Yes
    Ignore Response Cache-Control: No -> Yes

    see if it works on 4.2.6 and 4.2.7+
  3. ms_services

    ms_services Member

    Our cache rules as stated above work on 2.6.

    After 2.7, users who are logged in will see logged out/cached pages.
    They will also not see posts they make until they hard refresh, even that doesn't work sometimes.
    Basically it seems logged in members are seeing cached pages. Which shouldn't happen.

    Something changed.

    Have removed the L and tried again with 2.9 and we started seeing the same problem again. So we reverted back to 2.6.

    BTW what is the significance of removing the "L"?
  4. NiteWave

    NiteWave Administrator

    can you force-reinstall 4.2.9 to ensure latest version, and try again ?

    "L" mean last rewrite rule. this will disable rest rewrite rules. so better to remove "L".
  5. mistwang

    mistwang LiteSpeed Staff

    Ignore Request Cache-Control
    Ignore Response Cache-Control

    should be set to yes. whether to use cache is only controlled by rewrite rule.

    If still have problem, may need to turn on rewrite logging and debug logging to find out why cache was enabled.
  6. ms_services

    ms_services Member

    Testing, thanks for the update.
  7. ms_services

    ms_services Member

    At this point:

    we've disabled all caching via rewrite
    and seeing the same behavior.
    Everything works fine at 2.6, at 2.9 users start complaining about cache issues.

    We go through 100K+ visitors/day and significant logged in sessions.
    I too am experiencing this behavior on any accounts I create.

    We are using xcache for php cache

    following cache settings in server:

    this is the headers i get when logged in:
    headers i get when logged out
    I would stick to 2.6, only problem is we're going to be having a payment page soon and would like to be up to to 2.9 for the heart bleed issue

    quick question: once set in the server tab, do we also have to configure caching rules for virtualhost, as of now virtual host settings for cache area all set to "not set".
    Last edited: Apr 23, 2014
  8. NiteWave

    NiteWave Administrator

    "not set" mean inheriting server's setting.

    I can log into your server to take a complete check regarding the cache issue. Please PM me the access if you're ok.
  9. ms_services

    ms_services Member

    Was able to get the caching to stop on 2.9 when enabling vbulletin's "Add No-Cache Option"

    I think it has to do:
    Cache-Controlpublic, max-age=86400

    being sent out automatically when no cache control has been set.
  10. NiteWave

    NiteWave Administrator

  11. ms_services

    ms_services Member

    Ok, settings exact to the guide on our production server. I did a comparison for what was being outputted by headers between 2.6 vs 2.9.

    On 2.9 after every request this was being outputted at the end:
    Cache-Control: public, max-age=86400

    I did a scan on our source code and could not find anywhere where we had a manage 86400
    the control panel for litespeed has public max age set to 60

    when i swapped out to 2.6
    the cache-contro:public, max-age 86400 is gone. and everything works as should

    force reintall on 2.9 was done many times.
  12. NiteWave

    NiteWave Administrator

    86400 seconds means 1 day or 24 hours.
    can you search all .htaccess directives relating to "expire" and "cache-control"
  13. ms_services

    ms_services Member

    Found it, it wasn't in .htacces it was in expires setting for the server in LS Admin Panel.
    This was the one difference between server where caching was wonky and development where it seemed to work in 2.9

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

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

    Expires had been set for text/html 86400

    After removing it, things seem to be working better :)

    Well thanks for the support & help appreciate it.
    Keep up working on the great product and can't wait for 5.0 :)
  14. NiteWave

    NiteWave Administrator

    Thanks for the update :)
    image/icon=A604800 can be removed, since it's duplicated with image/*=A604800
    also lack of application/javascript=A604800

    so reverting back to the default settings(same as Development) is ok.

Share This Page