News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Caching issue on 2.0.11

Started by devilkin, July 24, 2016, 05:11:20 AM

Previous topic - Next topic

devilkin

Hello,

I'm the admin of an SMF board over at http://aelst.be/smf/

This runs fairly okay, but since a few weeks(?) I've been getting complaints about users sometimes seeing someone else's session when they initially load the forum. After clicking on a link somewhere it goes to their session. Also happens when they're just reloading pages.
I also often get kicked back to a login window, even though I was logged in fine a second earlier.

Cookie settings are (right now):
* Local storage: no
* Subdomain independent: yes
* Secure cookies: no (not supported)
* DB driven cookies: yes
* Allow browsers to go back to a cached page: no
* Seconds before timeout: 43200

SMF Caching: none

I was wondering if this might have been an issue with the old SMF 1.1 I was running, so I upgraded to the latest stable (2.0.11), but the issue prevails.

What I've also noticed with 2.0.11 is that often the page doesn't reflect the latest status, I have to nearly wait a minute before updates are actual - including stuff in the admin section - I eg. delete an old package, it still shows up, until about a minute later, when it's gone.

I've checked on the hosting side, they're using Varnish for static content cache, but dynamic content is not cached. Furthermore, I've added the directive
Header set Cache-Control no-cache into .htaccess to avoid any form of caching.

Anyone got any idea what might be going on, or what I can check?
SMF 1.1.1, located at http://www.aelst.be/smf/

Illori

this or similar behavior has been reported before with varnish.

Quote from: foxbat on November 06, 2015, 08:01:38 AM
It's varnish. Damn. I'll figure out a way to exclude the forum URL root from caching. Thanks for the tip!

[edit] If anyone else is running varnish, has the forum on a sub-url (not subdomain) and needs to exclude it from caching. Just add a rule to the vcl_recv function in default.vcl that looks for an identifying part of your URL. e.g. for my case:


    if (req.url ~ "/forum/") {
        return(pass);
    }


This excluded the forum from caching without affecting the rest of the site.

devilkin

Quote from: Illori on July 24, 2016, 05:58:14 AM
this or similar behavior has been reported before with varnish.

Interesting. I had excluded the site from caching through .htaccess, but I guess it's not enough.
SMF 1.1.1, located at http://www.aelst.be/smf/

Arantor

That generally only enforces server-to-browser caching, it doesn't (usually, in my experience) actually tell Varnish not to cache the content.

Advertisement: