• Resolved Spirit Pixels

    (@spirit-pixels)


    Hello, I have a problem that logged in users see cached content. They need to refresh the page in order to see uncached content.

    Is there a way to make logged in users see uncached content right away?

    Thank you in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Logged in users should not see cached content when using Cache Enabler.

    Are they seeing something similar to:

    <!-- Cache Enabler by KeyCDN @ 10.11.2015 17:32:29 (html) -->

    when viewing the page source? Also what user role do these users have?

    Thread Starter Spirit Pixels

    (@spirit-pixels)

    Yes, on the bottom of the page source there is <!-- Cache Enabler by KeyCDN @ 10.11.2015 17:32:29 (html) -->. It is the case even for me, as Admin.

    I am using Cache Enabler and CDN Enabler. Cache expiry is set to 24h, and cache minification is set to html. Also pre-compression is checked. But even without pre-compression it is the same.

    Thread Starter Spirit Pixels

    (@spirit-pixels)

    I am using Woocommerce, and WP Job Manager. So there are employer, and customer users.

    Thread Starter Spirit Pixels

    (@spirit-pixels)

    But to be more precise: Users see the cached version of the page, if they previously clicked on the cached version. And then when they log in, cached version pops up for them, so they need to refresh.

    If a user did not click and saw cached version, when logged in he WILL see uncached version.

    Thread Starter Spirit Pixels

    (@spirit-pixels)

    Actually, while I am writing this I realise it must be because of HTML minification. Because, if HTML minification is chosen there is surely HTML caching as well.

    Thread Starter Spirit Pixels

    (@spirit-pixels)

    Well, checked now, the same thing happens even when HTML minification disabled.

    Thread Starter Spirit Pixels

    (@spirit-pixels)

    If just HTML wouldn’t get cached… Or if HTML would be cached for very small amount of time, for example 30 seconds.

    Thread Starter Spirit Pixels

    (@spirit-pixels)

    Ok, I solved the problem. ??

    I added in .htaccess the following code

    <IfModule mod_expires.c>
      ExpiresActive on
    
    # Your document html
      ExpiresByType text/html "access plus 0 seconds"
    
    # Media: images, video, audio
      ExpiresByType audio/ogg "access plus 1 month"
      ExpiresByType image/gif "access plus 1 month"
      ExpiresByType image/jpeg "access plus 1 month"
      ExpiresByType image/png "access plus 1 month"
      ExpiresByType video/mp4 "access plus 1 month"
      ExpiresByType video/ogg "access plus 1 month"
      ExpiresByType video/webm "access plus 1 month"
    
    # CSS and JavaScript
      ExpiresByType application/javascript "access plus 1 week"
      ExpiresByType text/css "access plus 1 week"
    </IfModule>

    Where is most important thing HTML expiry length. Please, just check the code if it does not interfere with regular plugin functions.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Logged in users see cached pages’ is closed to new replies.