Guest page caching

JoyFreak

Formerly Zuse
I am having issues with the guest page cache working with Redis.

It seems that when I log out, the page seems to cache as if though I am still logged in when I am not. When I click my username, it gives an security error.

I have also tried it with Memcache and same thing.

My site is running behind Cloudflare FWIW.
 

rdn

Well-known member
This is LiteSpeed or Nginx Full page caching?

Cause I cannot re-produce this with default XenForo Full Page Caching.
 

MattW

Well-known member
This is LiteSpeed or Nginx Full page caching?

Cause I cannot re-produce this with default XenForo Full Page Caching.
This is the built in XF 2.1 guest page cache, using either Redis or Memcached

PHP:
$config['pageCache']['enabled'] = true;
$config['pageCache']['recordSessionActivity'] = true;
$config['cache']['context']['page']['namespace'] = 'xfredispagecache_';
$config['cache']['context']['page']['provider'] = 'Redis';
$config['cache']['context']['page']['config'] = [
        'host' => '127.0.0.1',
        'port' => 6379,
        'database' => 4
        ];
 

MattW

Well-known member
For info, when guest page cache is enabled, I don't see any of the XF headers

201858

Would expect:

201859
 

shimspedy

Well-known member
PHP:
$config['pageCache']['enabled'] = true;
$config['pageCache']['recordSessionActivity'] = true;
$config['cache']['context']['page']['namespace'] = 'xfredispagecache_';
$config['cache']['context']['page']['provider'] = 'Redis';
$config['cache']['context']['page']['config'] = [
'host' => '127.0.0.1',
'port' => 6379,
'database' => 4
];
why don't i see this in the config file?
 

MattW

Well-known member
Default theme is the same as well. I've never seen the built in XF page cache do this before (and I've set it up dozens of times on different sites).
 

eva2000

Well-known member
Default theme is the same as well. I've never seen the built in XF page cache do this before (and I've set it up dozens of times on different sites).
if you bypass cloudflare privately to the origin, does guest page caching work ?
 

eva2000

Well-known member
If works, but not as expected. Same as above.
it works as in guest page cache works to only cache for guests and logout doesn't cache when bypassing cloudflare ? or you mean bypassed cloudflare, still results in logged out uses being caught in guest caching ?
 

MattW

Well-known member
When you log out, you get the same page you had prior to logging out. It get's stuck on that page, and the browser shows a 304 not modified. It still shows you as being logged in (even though you aren't). Navigating off the home page, shows you not logged in, but going back to the home page, shows you logged in.
 

dinhphucv

Member
@eva2000 can I switch to your guest page, css cache (with xon's add-on) at: https://community.centminmod.com/threads/xenforo-2-1-0-beta-1-install-2-1-0-final-upgrade-on-centmin-mod-123-09beta01-lemp-stack.16060/
This is my current one, any changes or just use same as yours.
Code:
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'xfredis_';
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config'] = array(
    'server' => '127.0.0.1',
    'port' => 6379,
    'connect_retries' => 2,
    'use_lua' => true,
    'compress_data' => 6,
    'read_timeout' => 1,
    'timeout' => 1,
    'serializer' => 'igbinary',
    'persistent' => true,
);
 

eva2000

Well-known member
@eva2000 can I switch to your guest page, css cache (with xon's add-on) at: https://community.centminmod.com/threads/xenforo-2-1-0-beta-1-install-2-1-0-final-upgrade-on-centmin-mod-123-09beta01-lemp-stack.16060/
This is my current one, any changes or just use same as yours.
you can try as it's what i use on my test xf 2.1 forums

When you log out, you get the same page you had prior to logging out. It get's stuck on that page, and the browser shows a 304 not modified. It still shows you as being logged in (even though you aren't). Navigating off the home page, shows you not logged in, but going back to the home page, shows you logged in.
same happens if you log out and close and reopen your browser ? what do you have in CF cache level/browser cache expiration settings ?

201894
 

MattW

Well-known member
same happens if you log out and close and reopen your browser ? what do you have in CF cache level/browser cache expiration settings ?
Cloudflare is irrelevant, I totally disabled it, and routed traffic direct to the site. Still exactly the same.

The page returned a 304 not modified header, so was showing the cached page specific to my browser. If I totally disabled local browser cache, I got the correct page returned (via chrome developer tools).
 

eva2000

Well-known member
Cloudflare is irrelevant, I totally disabled it, and routed traffic direct to the site. Still exactly the same.

The page returned a 304 not modified header, so was showing the cached page specific to my browser. If I totally disabled local browser cache, I got the correct page returned (via chrome developer tools).
Strange then. You have also enabled session cache and enabled native XF 2.1 global cache to use redis as well ?
 

JonathanW

Well-known member
I went from not being able to recreate the issue to now being plagued with it and am not having much luck in figuring it out either.
 

eva2000

Well-known member
Cloudflare is irrelevant, I totally disabled it, and routed traffic direct to the site. Still exactly the same.

The page returned a 304 not modified header, so was showing the cached page specific to my browser. If I totally disabled local browser cache, I got the correct page returned (via chrome developer tools).
FYI, seems site redirects seem mis-configured. Whether or not that is the issue though ??
Code:
https://joyfreak.com/ 301 redirect -> http://www.joyfreak.com/
http://joyfreak.com/ 301 redirect --> http://www.joyfreak.com/
http://www.joyfreak.com/ HTTP 200 answered instead of redirect to https://www.joyfreak.com/
 

JonathanW

Well-known member
FYI, seems site redirects seem mis-configured. Whether or not that is the issue though ??
Code:
https://joyfreak.com/ 301 redirect -> http://www.joyfreak.com/
http://joyfreak.com/ 301 redirect --> http://www.joyfreak.com/
http://www.joyfreak.com/ HTTP 200 answered instead of redirect to https://www.joyfreak.com/
Doubt it, since the issue is non-existent without guest page caching enabled. Good catch though, I'll straighten this out for him.
 
Top