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

Remove no-cache and max-age=0 from bfcache failure conditions #1826

Merged
merged 4 commits into from
Jan 26, 2025

Conversation

westonruter
Copy link
Member

Summary

Fixes #1825

@westonruter westonruter added [Type] Bug An existing feature is broken [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only skip changelog PRs that should not be mentioned in changelogs labels Jan 25, 2025
@westonruter westonruter added this to the performance-lab 3.8.0 milestone Jan 25, 2025
Copy link

github-actions bot commented Jan 25, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: westonruter <[email protected]>
Co-authored-by: felixarntz <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@westonruter westonruter changed the base branch from trunk to release/3.8.0 January 25, 2025 21:47
Copy link

codecov bot commented Jan 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release/3.8.0@2b1bf18). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release/3.8.0    #1826   +/-   ##
================================================
  Coverage                 ?   65.86%           
================================================
  Files                    ?       88           
  Lines                    ?     6855           
  Branches                 ?        0           
================================================
  Hits                     ?     4515           
  Misses                   ?     2340           
  Partials                 ?        0           
Flag Coverage Δ
multisite 65.86% <100.00%> (?)
single 38.45% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This was referenced Jan 25, 2025
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@westonruter Great catch, LGTM! Just one non-blocking feedback.

)
)
),
__( "The <code>Cache-Control</code> response header for an unauthenticated request to the home page includes the <code>no-store</code> directive. This can affect the performance of your site by preventing fast back/forward navigations (via the browser's bfcache).", 'performance-lab' ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, but for the code constructs using placeholders would be nice, since they shouldn't be translatable - plus it avoids the need for translators to deal with HTML in the string, which is always good if it can be avoided.

Suggested change
__( "The <code>Cache-Control</code> response header for an unauthenticated request to the home page includes the <code>no-store</code> directive. This can affect the performance of your site by preventing fast back/forward navigations (via the browser's bfcache).", 'performance-lab' ),
sprintf(
/* translators: 1: header name, 2: problematic directive */
__( "The %1$s response header for an unauthenticated request to the home page includes the %2$s directive. This can affect the performance of your site by preventing fast back/forward navigations (via the browser's bfcache).", 'performance-lab' ),
'<code>Cache-Control</code>',
'<code>no-store</code>'
),

Copy link
Member Author

@westonruter westonruter Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works: ffa9c25 (with a couple tweaks)

image

@westonruter westonruter enabled auto-merge January 26, 2025 02:12
@westonruter westonruter disabled auto-merge January 26, 2025 02:13
@westonruter westonruter merged commit e2effe6 into release/3.8.0 Jan 26, 2025
16 checks passed
@westonruter westonruter deleted the fix/bfcache-conditions branch January 26, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only skip changelog PRs that should not be mentioned in changelogs [Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test for bfcache compatibility incorrectly flags use of no-cache and max-age=0
2 participants