WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WP Super Cache] Multiples caches of same page (7 posts)

  1. domingou
    Member
    Posted 5 years ago #

    If i delete the cache and then access a page with different browsers (ie, firefox, chrome) I get a new page for each browser getting 3 caches of the same page. Is this the expected behavior?

    Cheers
    D

  2. Donncha O Caoimh
    Member
    Posted 5 years ago #

    Do you mean you get 3 WP-Cache caches? What are the filenames?

  3. domingou
    Member
    Posted 5 years ago #

    wp-cache-aa71e670a69e4ec1c393c4f25199ba15.html
    wp-cache-6a80940d9bd8acbb47117b60b6c1982e.html
    wp-cache-6a0325dcd6c8b6befcd5019229453251.html

    The three are the same page with equal size

    By the way this happens with many pages of my site, that on cache are duplicated.

    Cheers
    D

  4. Donncha O Caoimh
    Member
    Posted 5 years ago #

    I just looked in my own cache directory and haven't seen this, and the code that generates the md5 string doesn't include the browser user agent. Not sure how that's happening.

  5. Murmatron 2
    Member
    Posted 5 years ago #

    Donncha,

    I can replicate that easily logging in with multiple browsers, and to a lesser extent when not logged in. Neither scenario has anything to do with the browsers themselves.

    The following are from Opera & Safari both logged in as admin on the same site:

    Opera: WP Cookie check,admin|1225358221|aaa0fa7a513774eb2af8a6a09ebb7fb6,
    Safari: admin|1224321519|1a689ac78c2fe15a07952c854d52ab23,WP Cookie check,

    The hashes are different, but even if they were the same, the order of the cookies would cause separate cache files to be created, as would the different timestamps. The different cookie order comes (I believe) from the fact that Safari was logged in, whereas Opera was logged in, out and in again.

    Fact: Multiple browsers logged in as the same user will almost certainly generate separate cache files.

    I've also seen the following when logged in...

    admin|1225358221|8228982bd4af22eb1476cb3f01dc1daa,WP Cookie check,admin|1225358221|aaa0fa7a513774eb2af8a6a09ebb7fb7,

    i.e. Multiple user cookies with the same timestamp, but different hashes. This is usually short-lived; one of them will eventually disappear.

    As for not logged in users; there is an issue with the default name of TEST_COOKIE in wp-settings.php which causes users who were logged in (or failed to log in) to be treated as though they are - i.e. no SuperCache...

    if ( !defined('TEST_COOKIE') )
    	define('TEST_COOKIE', 'wordpress_test_cookie');

    Adding something like...

    define('TEST_COOKIE', 'wp_test_cookie');

    ...to wp-config.php gets around that problem by removing that cookie from supercache's regex radar and also removes it as a potential problem source with respect to cookie order for logged in users.

    Fact: With the default TEST_COOKIE, a never-logged-in browser will generate a separate cache file from one which was logged in (or attempted, but failed).

    If lots of browsers are logged in as the same user, as far as I can see; all bets are off, but I really think it's a non-issue. How many end-users are going to be browsing the site logged-in with multiple browsers?

    P.S. This is all on my dev site which is a WordPress trunk checkout with nearly everything using default values.

  6. domingou
    Member
    Posted 5 years ago #

    Thanks for that great explanation Murmatron 2, now I understand how it works.

    Cheers
    D

  7. Donncha O Caoimh
    Member
    Posted 5 years ago #

    Thanks for debugging that! I agree it's not a common case but perhaps the plugin should watch out for the test cookie, just in case.

Topic Closed

This topic has been closed to new replies.

About this Topic