Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Site Cache Deletion Issue with WP Rocket's Background CSS Image Caching #6340

Open
admdanielspalma opened this issue Dec 18, 2023 · 10 comments
Labels
module: lazyload background css images multisite needs: grooming priority: medium Issues which are important, but no one will go out of business. severity: major Feature is not working as expected and no work around available type: bug Indicates an unexpected problem or unintended behavior

Comments

@admdanielspalma
Copy link

WP Rocket's recent implementation of the "Activate for CSS background images" feature creates a folder at /public_html/wp-content/cache/background-css. This folder is at the same directory level as /wp-content/cache/wprocket. In a WordPress multisite setup, when the cache is cleared on one site, it deletes the entire contents of the /public_html/wp-content/cache/background-css folder. This action inadvertently affects other sites on the network, breaking their functionality. This issue suggests that in a multisite environment, this feature cannot be used without causing interferences among sites.

To Reproduce
Steps to reproduce the behavior:

Set up a WordPress multisite network.
Enable WP Rocket and the feature "Activate for CSS background images". Clear cache to recreate files.
Notice the creation of the /public_html/wp-content/cache/background-css folder. Wait it to be populated.
Clear the cache on OTHER of the sites in the network.
Observe that the entire contents of the /public_html/wp-content/cache/background-css folder are deleted, impacting other sites on the network.

Expected behavior:
The expected behavior is that clearing the cache on one site should not affect the cached content of other sites in a multisite network, particularly not deleting the entire contents of shared cache folders like /background-css.

Additional context:
This issue is particularly critical in environments where multiple sites are relying on WP Rocket for performance enhancements, as it leads to unexpected downtime and broken site functionality.

Suggestions:
Ensure that cache clearing in one site of a multisite network does not affect the cache of other sites, especially in shared folders like /background-css.
Implement a mechanism to isolate cache clearance activities to the site where it's initiated.
Test across different multisite setups to ensure robustness of the solution.

@piotrbak piotrbak added multisite priority: medium Issues which are important, but no one will go out of business. severity: major Feature is not working as expected and no work around available module: lazyload background css images labels Dec 19, 2023
@piotrbak
Copy link
Contributor

Hello @admdanielspalma thanks for creating the issue. Could you tell me what kind of multisite you're running? Subdirectory, subdomains or mapped domains?

Thanks

@admdanielspalma
Copy link
Author

Hello!

I'm using a subsite installation with Top Level Domains as its roots.

@RomelloKortbeek
Copy link

Hi!
I’m having the same issue on my multisite (with subdomains).
Following this issue, hopefully it will get fixed soon :)

@admdanielspalma
Copy link
Author

I've been struggling with this since it was implemented... but I didn't know what was causing the problem before. I hope it doesn't take too long to fix. Does anyone know if it usually takes a long time?

@admdanielspalma
Copy link
Author

admdanielspalma commented Jan 17, 2024

Hello @admdanielspalma thanks for creating the issue. Could you tell me what kind of multisite you're running? Subdirectory, subdomains or mapped domains?

Thanks

Hello!
Shouldnt we set the TYPE-BUG tag?

@piotrbak piotrbak added the type: bug Indicates an unexpected problem or unintended behavior label Jan 29, 2024
@admdanielspalma
Copy link
Author

This another bug was posted 2 weed ago and is already fixed.😅

#6389

Will the bug of this topic be in the queue? Thanks

@piotrbak
Copy link
Contributor

piotrbak commented Feb 5, 2024

Hello @admdanielspalma yes, we'll handle this problem soon.

@remyperona
Copy link
Contributor

@CrochetFeve0251 Your input would be good on this one for the following point:

I can see that the background CSS cache folder is set by default to background-css in Common\ExtractCSS\ServiceProvider, but it's set to background-css/' . get_current_blog_id() in Media\Lazyload\CSS\ServiceProvider.

When testing the background CSS cache path during the clear(), the value doesn't contain the blog ID.

On another level, the cache clear should happen based on the current site domain (the cache and mapping files are created inside sub-folders of a main folder named after the site domain), but it's currently deleting the whole background-css folder as reported.

@admdanielspalma
Copy link
Author

Hello. Was it fixed?

@abecuwedahive
Copy link

+1. This issue is really annoying because we have a multisite with 20+ blogs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: lazyload background css images multisite needs: grooming priority: medium Issues which are important, but no one will go out of business. severity: major Feature is not working as expected and no work around available type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants