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

Empty the wpr_rocket_cache table after a domain migration #5549

Open
4 tasks
alfonso100 opened this issue Nov 7, 2022 · 2 comments · May be fixed by #6696
Open
4 tasks

Empty the wpr_rocket_cache table after a domain migration #5549

alfonso100 opened this issue Nov 7, 2022 · 2 comments · May be fixed by #6696
Assignees
Labels
effort: [S] 1-2 days of estimated development time module: preload priority: medium Issues which are important, but no one will go out of business. type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Milestone

Comments

@alfonso100
Copy link
Contributor

alfonso100 commented Nov 7, 2022

Before submitting an issue please check that you’ve completed the following steps:
yes - Made sure you’re on the latest version
yes - Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug
When a site changes the domain, for example when moving from Staging to Production, the wpr_rocket_cache table will carry entries referencing the old domain. Attempting to preload these URLs add extra CPU usage

Deactivating/reactivating the Preload option won't clear these URLs

To Reproduce
Steps to reproduce the behavior:

  1. Stagecoach a website with Preload enabled. Doesn't matter if WP Rocket is active or not
  2. Disable, Enable the preload, and check the wpr_rocket_cache table again. It will contain the old ULRs
  3. Start browsing some URLs, these will be added to the cache table
  4. See the cache table containing Old and New URLs

Expected behavior
After a domain change, the wpr_rocket_cache table should be cleared.

Screenshots
TqA8wnY

Backlog Grooming (for WP Media dev team use only)

  • Reproduce the problem
  • Identify the root cause
  • Scope a solution
  • Estimate the effort
@piotrbak piotrbak added type: enhancement Improvements that slightly enhance existing functionality and are fast to implement module: preload priority: medium Issues which are important, but no one will go out of business. labels Nov 17, 2022
@piotrbak
Copy link
Contributor

piotrbak commented Jun 3, 2024

The AC:
When clicking on the banner from the notice we should:

  1. Purge the cache table, purge the RUCSS table, purge the OCI table
  2. Schedule the sitemap/homepage link fetching for the preload (if enabled)
  3. Schedule the prewarmup for the OCI (if enabled and it's dependent on the 3.16.1, since the process will be async)

@Tabrisrp
Copy link
Contributor

Tabrisrp commented Jun 4, 2024

Scope a solution ✅

  • Purging the RUCSS & OCI tables are already handled

Engine\Preload\Admin\Settings

  • Add new dependencies CacheTable and LoadInitialSitemap
  • Add a new method clear_and_preload() that will truncate the cache table, and initiate the sitemap/homepage preload if the preload option is enabled

Engine\Preload\Admin\Subscriber

  • Update the callback on rocket_domain_options_changed to the new method clear_and_preload()

Engine\Preload\Database\Tables\Cache

  • Add a method to check if the table exists, and truncate it

Engine\Media\AboveTheFold\Warmup\Subscriber

  • Add callback warm_up on rocket_domain_options_changed

Estimate the effort ✅

Effort S

@Tabrisrp Tabrisrp added the effort: [S] 1-2 days of estimated development time label Jun 4, 2024
@Tabrisrp Tabrisrp self-assigned this Jun 4, 2024
@Tabrisrp Tabrisrp linked a pull request Jun 4, 2024 that will close this issue
9 tasks
@piotrbak piotrbak added this to the 3.16.2 milestone Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [S] 1-2 days of estimated development time module: preload priority: medium Issues which are important, but no one will go out of business. type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants