Clear Cache button doesn't clear Child-Site Logged-In User Home Page cache on WordPress Multisite #409

Closed
raamdev opened this Issue Feb 4, 2015 · 13 comments

Projects

None yet

3 participants

@raamdev
Member
raamdev commented Feb 4, 2015

Steps to recreate this bug

  1. Network Activate Quick Cache Pro (tested with v150129) in a WPMU environment (tested with WPMU using sub-directories) with at least one Child Site

  2. Enable Logged-In User caching an maintain a separate cache for each user (Quick Cache ⥱ Plugin Options ⥱ Logged-In Users → Yes, and maintain a separate cache for each user)

  3. Logout of Network Admin and login to the site as a Child Site user to generate some user-specific cache files. Visit at least the Home Page and one other page on the Child Site.

  4. You should now have cache files for the child site inside wp-content/cache/quick-cache/cache/ that represent something like the following (assuming the Child Site subdirectory is /child1/):

    ├── child1
    │   └── sample-page.u
    │       └── 7.html
    └── child1.u
        └── 7.html
    
  5. Now return to the Network Admin and visit the Child Site Dashboard (in this example, the Dashboard for child1).

  6. Click the "Clear Cache" button to clear the cache for the Child Site.

  7. Quick Cache reports that 2 cache files were cleared, as we would expect:
    2015-02-03_22-20-25

  8. However, if we check the Child Site cache directory to verify that all cache files have been cleared, we find that the user-specific Home Page cache file (/child1.u/7.html) remains:

    ├── child1
    └── child1.u
        └── 7.html
    

It appears that site-specific clearing of all cache files does not properly clear the Home Page cache files for logged-in users.

Note: If we click "Clear Cache" from the Network Admin Dashboard (to clear all cache files for all sites), all cache files are cleared as expected.


Also affecting non-logged in users

@tomlinsongu reports below that this seems to also be affecting non-logged in users. When the Child Site cache is cleared (whether by an automatic routine or by the clear cache button), the Home Page cache for non-logged in users (i.e., the default home page cache file) for that Child Site is not cleared.

I have not confirmed this yes, so that part needs testing.

[Update 2015-08-05]: I received another report of the regular Home Page cache (NOT Logged-In User Home Page cache) not clearing on a Child Site: https://websharks.zendesk.com/agent/tickets/7711


Support threads referencing this issue

@raamdev raamdev added this to the Next Release milestone Feb 4, 2015
@raamdev raamdev changed the title from Clear Cache button doesn't clear Home Page cache on WordPress Multisite to Clear Cache button doesn't clear Child-Site Logged-In User Home Page cache on WordPress Multisite Feb 4, 2015
@tomlinsongu

Hi raamdev,

I'm having a problem where the home page cache files are not being cleared for non-logged in users as well, whether it's when using the site Clear Cache button, or the automatic Home Page update when editing a post. I reported this to WebSharks, and they suggested commenting about it here.

Thanks!

@raamdev
Member
raamdev commented Mar 5, 2015

@tomlinsongu Are you using WordPress Multisite? Are you seeing this when trying to clear the Child Site cache?

@tomlinsongu

Yes, I'm using WordPress Multisite, and when I clear the Child Site cache, the home page cache files are not cleared. Also, when I update a post, the home page cache file for that child site is not updated (sometimes I'll get a message saying it is, and sometimes I won't, but it is never updated).

@raamdev
Member
raamdev commented Mar 5, 2015

@tomlinsongu Thank you for the additional information. I have updated this GitHub Issue to include note of the home page cache not clearing for non-logged in users.

@tomlinsongu

Thank you! Let me know if you need to see an example of it in action.

@raamdev
Member
raamdev commented Mar 6, 2015

@tomlinsongu One thing that would help is if you can test the beta when it's released. If you're interested in testing a beta release of Quick Cache before the next version comes out, please sign-up to be a beta tester here.

@raamdev raamdev modified the milestone: Next Release, Future Release Mar 13, 2015
@raamdev raamdev modified the milestone: Next Release, Future Release Apr 10, 2015
@raamdev raamdev modified the milestone: Next Release, Future Release Jun 5, 2015
@raamdev
Member
raamdev commented Jul 1, 2015

This bug needs to be retested against the latest ZenCache release (v150626), as there were many improvements and fixes related to WordPress Multisite Networks and this issue may already be resolved.

@tomlinsongu

By my testing, this issue appears to be resolved by the latest ZenCache release. Thank you!

@raamdev raamdev self-assigned this Jul 9, 2015
@raamdev
Member
raamdev commented Jul 9, 2015

@tomlinsongu Thank you very much for the update! I'm going to test this myself just to make sure we have two confirmations that the bug does not exist and then I will close this issue.

@jaswsinc jaswsinc pushed a commit to websharks/comet-cache-pro that referenced this issue Jul 31, 2015
jaswsinc Adding TODO for websharks/comet-cache#536 & websharks/comet-cache#409 d1b8ff0
@jaswsinc jaswsinc pushed a commit to websharks/comet-cache-pro that referenced this issue Jul 31, 2015
jaswsinc Bug fix. See: websharks/comet-cache#536 websharks/comet-cache#409 c286957
@raamdev
Member
raamdev commented Aug 2, 2015

Copying comments from @jaswsinc in #536 here so that we can close the other duplicate issue.


@jaswsinc writes...

Overview

Clearing the cache on a multisite network fails for user-specific cache entries, or any other dotted sub-directory whenever the primary site has not yet been hit any user who is not logged in.

Steps to Reproduce

  • Setup multisite network w/ sub-directories.
  • Create blogs for children: example.com/child1, example.com/child2
  • Enable ZenCache.
  • Enable User caching with a separate cache for each user.
  • Wipe the cache.
  • Hit the front page for example.com/child1 as a logged-in user and let it cache you.
  • Clear (not Wipe) the cache.

Expected Behavior

That the cache for that user should be cleared along w/ anything else.

Observed Behavior

In this particular scenario, a sub-directory is expected to exist for the child blog. However, instead we only have zencache/cache/http/example-com/child1.u (a user-specific cache only). This fails because of this check that assumes it is a host-specific directory, when in fact it could be host and child blog specific also.


This issue is actually a bit more complex than I first thought. It might take some refactoring to get this right in all circumstances.

@raamdev raamdev assigned jaswsinc and unassigned raamdev Aug 2, 2015
@raamdev raamdev added lite pro and removed needs testing labels Aug 2, 2015
@raamdev
Member
raamdev commented Aug 5, 2015

Added to original issue body: ↑ [Update 2015-08-05]: I received another report of the regular Home Page cache (NOT Logged-In User Home Page cache) not clearing on a Child Site: https://websharks.zendesk.com/agent/tickets/7711

@raamdev raamdev added DMOZL and removed lite labels Aug 12, 2015
@raamdev
Member
raamdev commented Aug 12, 2015

Next Pro Release Changelog:

  • Multisite Bug Fix: Fixed a bug where the Clear Cache button wouldn't clear Child-Site Logged-In User Home Page cache files on WordPress Multisite Networks. See Issue #409
  • Multisite Bug Fix: Fixed a bug where the Home Page cache was not clearing on Child Sites in a Multisite Network. See Issue #409
@raamdev raamdev closed this Aug 12, 2015
@raamdev
Member
raamdev commented Aug 21, 2015

ZenCache Pro v150821 has been released and includes changes from this GitHub Issue.

See the ZenCache Pro v150821 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#409).

@raamdev raamdev locked and limited conversation to collaborators Aug 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.