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

Status
Not open for further replies.
#1
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
RewriteCond %{HTTP_COOKIE} !bbimloggedin=yes
RewriteCond %{QUERY_STRING} !s=[a-fA-F0-9]{32}
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{REQUEST_URI} !^(login|register|usercp|private|profile|cron|image|search)\.php$
RewriteCond %{REQUEST_URI} !^admincp
RewriteRule ^(.*)?$ - [L,E=Cache-Control:max-age=240]
// here is where we say don't cache if user that is logged in
if ( $vbulletin->userinfo['userid'] || $vbulletin->options["mob_detected_device_name"])
{
//header('X-Accel-Expires: 0');
header('X-LiteSpeed-Cache-Control: no-cache');
};
// here is where we set cookie for users that are logged in
if ($send_cookies AND $cookieuser)
{
// Cookie user
vbsetcookie('imloggedin', 'yes', true, true, true);
}
else
{
// Not permanent
vbsetcookie('imloggedin', 'yes', false, true, true);
}
//Here are server settings for cache
Enable Cache
No

Cache Expire Time (seconds)
Not Set

Cache Stale Age (seconds)
Not Set

Cache Request with Query String
Yes

Cache Request with Cookie
Yes

Cache Response with Cookie
Yes

Ignore Request Cache-Control
No

Ignore Response Cache-Control
No

Enable Private Cache
No

Private Cache Expire Time (seconds)
Not Set
 
Last edited:

NiteWave

Administrator
#2
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]
==>
Code:
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+
 
Last edited by a moderator:
#3
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"?
 

NiteWave

Administrator
#4
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".
 

mistwang

LiteSpeed Staff
#5
both
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.
 
#7
At this point:

we've disabled all caching via rewrite
# rules for litespeed cache:
#RewriteCond %{HTTP_COOKIE} !vbseo_loggedin=yes
#RewriteCond %{HTTP_COOKIE} !bbimloggedin=yes
#RewriteCond %{HTTP_COOKIE} !^.*bbuserid.*$ [NC]
#RewriteCond %{HTTP_COOKIE} !^.*bbpassword.*$ [NC]
#RewriteCond %{QUERY_STRING} !s=[a-fA-F0-9]{32}
#RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
#RewriteCond %{REQUEST_URI} !^(login|register|usercp|private|profile|cron|image|search)\.php$
#RewriteCond %{REQUEST_URI} !^admincp
#RewriteRule ^(.*)?$ - [L,E=Cache-Control:max-age=240]
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:
enable cache:no
cache expire time: 1
cache stale age: 1
cache request with query string: no
cache request with cookie: no
ignore request cache-control: yes
ignore response cache-control: yes
enable private cache: no
privace cache expire time: 1

this is the headers i get when logged in:
StatusHTTP/1.1 200 OK
Request
Accepttext/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encodinggzip,deflate,sdch
Accept-Languageen-US,en;q=0.8


Cache-Controlprivate
Cache-Controlpublic, max-age=86400
Content-Encodinggzip
Content-Typetext/html; charset=ISO-8859-1
DateWed, 23 Apr 2014 00:59:38 GMT
ExpiresSat, 26 Jul 1997 05:00:00 GMT
ExpiresThu, 24 Apr 2014 00:59:38 GMT
Pragmaprivate
VaryAccept-Encoding
headers i get when logged out
StatusHTTP/1.1 200 OK
Request
Accepttext/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encodinggzip,deflate,sdch
Accept-Languageen-US,en;q=0.8


Cache-Controlprivate
Cache-Controlpublic, max-age=86400
Content-Encodinggzip
Content-Typetext/html; charset=ISO-8859-1
DateWed, 23 Apr 2014 00:59:51 GMT
ExpiresThu, 24 Apr 2014 00:59:51 GMT
Pragmaprivate
VaryAccept-Encoding
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:

NiteWave

Administrator
#8
"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
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:
Code:
Cache-Controlpublic, max-age=86400
being sent out automatically when no cache control has been set.
 
Last edited by a moderator:
#11
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.
 
#13
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

Development
Code:
image/*=A604800, text/css=A604800, application/x-javascript=A604800, application/javascript=A604800
Production
Code:
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 :)
 
Last edited by a moderator:
#14
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.
 
Status
Not open for further replies.
Top