• Resolved joneiseman

    (@joneiseman)


    If I turn on file based caching it will cause the browser to cache pages (I do not select to cache for logged in users). However, if someone is not logged in and then logs in they will still get the cached pages unless they refresh the page. Is there some way to force the browser to refresh after a login? Is there some way to disable file caching for particular pages? For now, I have just turned off file based caching.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Simeon Boev

    (@k3llanved)

    Hello @joneiseman,

    The file-based cache creates an HTML version of each page and stores it as a file for better and faster delivery. We do not serve cached content to any request that includes COOKIE of any sort, thus logged-in users would not receive a cached response from the server/application. The behavior you mention is not something that should occur. Can you give us steps to recreate the issue in question?

    Best Regards,
    Simeon Boev

    Thread Starter joneiseman

    (@joneiseman)

    Hi Simeon,

    I can’t give you steps to recreate the issue because it doesn’t happen every time. On my website the version of some pages is different depending on whether or not you are logged in. Sometimes after logging in the version of the page is the non-logged in version instead of the logged in version. Refreshing the page will then get the logged in version of the page. So, I think the problem is on the server side that it’s returning the cached version of the page after login and then refreshing the page gets the non cached version of the page from the server.
    The File Caching changes the http request header. With the File caching turned on it has the following in the request header (when I’m not logged in):
    cache-control: max-age=0
    Without the File caching it has the following in the request header:
    cache-control: no-cache
    In the response header when not logged in I see the following:
    sg-f-cache: HIT
    I don’t see this when logged in and get the non cached page. I don’t know what it shows in the case when I’m logged in (but get the cached page) but I suspect it would show the sg-f-cache entry in the response header.
    The server should always return the non-cached page when the user is logged in (since I didn’t turn on caching for logged in users).

    Best Regards,
    Jon

    Plugin Support Pavel Dosev

    (@pdosev)

    Hello Jon,

    I tried to recreate the issue on my end on a default WordPress installation, but the headers I get back when the File cache is turned on/off in both cases is cache-control: no-cache.

    It will be easier to check this by trying to recreate the issue. If your site is hosted with Siteground, we can prevent it. It is against the forum rules to provide any details etc. Thus, please submit a ticket to us with a description of the problem and how to recreate it. We can check it on the site or a staging copy and try to determine what might be causing it.

    Plugin Support Gergana Petrova

    (@gpetrova)

    Hello @joneiseman,

    We haven’t heard back from you in the past couple of days and we will be marking the topic as Resolved. You will still be able to post new replies, in case there are any further details that you can share.

    We remain available over the SiteGround’s Support HelpDesk as well.

    Best Regards,
    Gergana Petrova

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘file caching for logged in users’ is closed to new replies.