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

On fresh installs, OCI warm-up for not-homepages might be missing mobile requests if the task is triggered before options are set #6752

Closed
MathieuLamiot opened this issue Jul 1, 2024 · 0 comments · Fixed by #6753
Assignees
Milestone

Comments

@MathieuLamiot
Copy link
Contributor

Context
https://wp-media.slack.com/archives/CUKB44GNN/p1719826680391649?thread_ts=1719582525.193069&cid=CUKB44GNN

When running the async tasks for not-homepages of OCI warm-up, there are cases where cache_mobile and do_caching_mobile_files options are not set. In this case, we don't send the mobile requests.

Expected behavior
On fresh installs, the OCI warm-up for non-homepages should always send requests for mobile & desktop, unless a filter is applied to control cache_mobile and do_caching_mobile_files.

Acceptance Criteria
⚠️ The issue is not happening consistently: several tries are required to make it happen, as it is a race condition between OCI Warm up and plugin initialization.

  • On fresh install, without filters or manual changes on cache_mobile and do_caching_mobile_files, the plugin must send 2 requests to the SaaS for OCI Warm Up per eligible pages (mobile & dekstop).
  • On fresh install, if a filter or manual change controls cache_mobile and do_caching_mobile_files, then the filter/manual change must be applied and the warm up requests must behave accordingly.
  • On regular OCI warm-up (not a fresh install), without filters or manual changes on cache_mobile and do_caching_mobile_files , the plugin must send 2 requests to the SaaS for OCI Warm Up per eligible pages (mobile & dekstop).
    • On regular OCI warm-up (not a fresh install), if a filter or manual change controls cache_mobile and do_caching_mobile_files, then the filter/manual change must be applied and the warm up requests must behave accordingly.

Additional information
Proposed solution is to replace:

return $this->options->get( 'cache_mobile', 0 ) && $this->options->get( 'do_caching_mobile_files', 0 );

by

return $this->options->get( 'cache_mobile', 1 ) && $this->options->get( 'do_caching_mobile_files', 1 );

in is_mobile() of the OCI warm-up controller.

It could be the occasion to remove:

		$plugin_version = (string) get_rocket_option( 'version', '' );
		if ( ! $plugin_version ) { // We are warming up a fresh installation. Options are not set yet.
			return true;
		}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants