You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When AMP_Style_Sanitizer::fetch_external_stylesheet() fails to fetch an external stylesheet, it caches the a WP_Error in the transient as opposed to the stylesheet string. In both cases, the transient expires after a month. This should be more dynamic, namely:
Fetches that result in failures should be cached for a DAY_IN_SECONDS rather than MONTH_IN_SECONDS.
Fetches that are successful should actually use a transient expiration that reflects the Cache-Control response header, as long as the max-age is greater than some minimum amount (e.g. 1 day).
When
AMP_Style_Sanitizer::fetch_external_stylesheet()
fails to fetch an external stylesheet, it caches the aWP_Error
in the transient as opposed to the stylesheet string. In both cases, the transient expires after a month. This should be more dynamic, namely:DAY_IN_SECONDS
rather thanMONTH_IN_SECONDS
.Cache-Control
response header, as long as themax-age
is greater than some minimum amount (e.g. 1 day).See also this todo:
amp-wp/includes/sanitizers/class-amp-style-sanitizer.php
Line 1363 in a3aabc7
Originally referenced in in #2449 (comment).
The text was updated successfully, but these errors were encountered: