Raise default threshold for disabling CSS caching#4513
Conversation
|
@westonruter The option to reset is within the |
|
@schlessera Yes, in the --- a/includes/options/class-amp-options-manager.php
+++ b/includes/options/class-amp-options-manager.php
@@ -87,6 +87,11 @@ class AMP_Options_Manager {
$defaults['theme_support'] = amp_is_canonical() ? AMP_Theme_Support::STANDARD_MODE_SLUG : AMP_Theme_Support::TRANSITIONAL_MODE_SLUG;
}
+ // Reset premature disabling of transient caching.
+ if ( isset( $options['version'] ) && version_compare( $options['version'], '1.5.2', '<' ) ) {
+ unset( $options[ \AmpProject\AmpWP\Option::DISABLE_CSS_TRANSIENT_CACHING ] );
+ }
+
$options = array_merge( $defaults, $options );
// Migrate theme support slugs.
|
Co-Authored-By: Weston Ruter <westonruter@google.com>
westonruter
left a comment
There was a problem hiding this comment.
This seems to work. I opened wp shell and did:
AMP_Options_Manager::update_option( 'amp_css_transient_monitor_disable_caching', true );Then in wp shell I forced the upgrade routing to happen with the next page load:
AMP_Options_Manager::update_option( 'version', '1.5.1' );And when I reloaded Site Health I then saw:
* Raise default threshold from 50 to 5000 * Reset option for disabling CSS cache on update * Fix inverted logic in version check Co-Authored-By: Weston Ruter <westonruter@google.com> Co-authored-by: Weston Ruter <westonruter@google.com>
|
Build for testing: amp.zip (v1.5.2-alpha-20200402T192113Z-5935fdef5) |
|
It would be good to create an Issue for each PR. This one seems to be missing one. |
|
As discussed with @westonruter:
|
|
@amedina Noted! As this one is already merged, I'll add the issue template to the PR information above with brief and QA instructions. |
|
Also: if there is a PR and a corresponding issue, only the issue needs to be added to the board. If a PR has no linked issue, then it can be added to the board directly. |
|
All the PRs in the |
|
QA: The functionality is working as expected. |
* tag '1.5.2': Bump 1.5.2 Bump version to 1.5.1-RC1 Cache response status and headers when fetching external stylesheets (#4509) Fix securing multi-line mustache templates (#4521) Add CSS monitoring time series to Site Health debugging info (#4519) Update hostname used for WordPress TV embeds to fix external HTTP requests (#4524) Fix processing of element child sanitization loop when invalid elements are replaced with children (#4512) Account for more YouTube URL formats (#4508) Update selected featured image ID on select (#4453) Raise default threshold for disabling CSS caching (#4513) Cast i-amphtml-intrinsic-sizer dimensions to integers (#4506) Only move meta tags to the head when required and add processing for meta[http-equiv] (#4505) Fix failing tests (#4507) Bump 1.5.2-alpha


Summary
Raises the default threshold for disabling the CSS caching system from 50 to 5000.
See https://wordpress.org/support/topic/1-5-1-slow-causes-high-request-time/ for more contextual information about the problem this solves.
Expected Behaviour
The CSS transient caching monitoring should only disable the caching on high-traffic sites with highly volatile CSS.
Steps to reproduce
Not directly reproducible yet, communicating via https://wordpress.org/support/topic/1-5-1-slow-causes-high-request-time/ to find out more.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
amp_plugin_updateto reset the disable option.QA testing instructions
For the raised limit:
Infopage at the top.AMPsection.Threshold for monitoring stylesheet cachingshows5000 per dayFor the reset on update:
wp shell:AMP_Options_Manager::update_option( 'amp_css_transient_monitor_disable_caching', true );.Infopage at the top.AMPsection.Transient caching for stylesheets disabledshowstrue.Infopage at the top.AMPsection.Transient caching for stylesheets disabledshowsfalse.Demo
Changelog entry
Checklist