Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 16 months ago

#56041 closed enhancement (fixed)

Port Audit Full Page Cache from performance plugin to core

Reported by: furi3r's profile furi3r Owned by: furi3r's profile furi3r
Milestone: 6.1 Priority: normal
Severity: normal Version:
Component: Site Health Keywords: has-patch has-unit-tests has-dev-note
Focuses: performance Cc:

Description

As part of the performance module life cycle, we want to port this site health check to the core.
https://github.com/WordPress/performance/tree/trunk/modules/site-health/audit-full-page-cache

Attachments (1)

56041.diff (883 bytes) - added by costdev 2 years ago.
Fixes the @return type for the 'site_status_page_cache_supported_cache_headers' filter and uses str_contains() (polyfilled in WP 5.9)

Download all attachments as: .zip

Change History (26)

#1 @furi3r
3 years ago

  • Summary changed from Port Persistent Object Cache Health Check from performance plugin to core to Port Audit Full Page Cache from performance plugin to core

#2 @hellofromTonya
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #56040.

#3 @furi3r
3 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

@hellofromTonya I did a mistake when creating the ticket with the same title as the previous one, but updated after. This is indeed another Trac ticket (see the difference in the title), also the link to a different module.

Performance GH issue link: https://github.com/WordPress/performance/issues/391

Last edited 3 years ago by furi3r (previous) (diff)

#4 @hellofromTonya
3 years ago

  • Milestone set to Awaiting Review

Aha, yeah, it looked like a duplicate. Thanks @furi3r for updating it. Cheers :)

This ticket was mentioned in PR #2894 on WordPress/wordpress-develop by manuelRod.


3 years ago
#5

  • Keywords has-patch has-unit-tests added

Introducing Full Page Cache check into Site Health

Trac ticket: #56041

manuelRod commented on PR #2894:


3 years ago
#6

@Clorith @swissspidy @spacedmonkey feedback applied.

  1. Consistent and accessible badge color policy.
  2. Fixed translation comments.
  3. Do we need to use wp_safe_remote_get?

#7 @flixos90
2 years ago

  • Milestone changed from Awaiting Review to 6.1
  • Owner set to furi3r
  • Status changed from reopened to assigned

manuelRod commented on PR #2894:


2 years ago
#8

@felixarntz thanks for the feedback. I've replaces all "page caching" appearances with "page cache".

manuelRod commented on PR #2894:


2 years ago
#9

@felixarntz I've updated the PR with trunk and solved the conflicts. All good!

#10 @flixos90
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 54043:

Site Health: Introduce page cache check.

This changeset adds a new page_cache check which determines whether the site uses a full page cache, and in addition assesses the server response time. If no page cache is present and the server response time is slow, the check will suggest use of a page cache.

A few filters are included for customization of the check:

  • site_status_good_response_time_threshold filters the number of milliseconds below which the server response time is considered good. The default value is based on the server-response-time Lighthouse audit and can be altered using this filter.
  • site_status_page_cache_supported_cache_headers filters the map of supported cache headers and their callback to determine whether it was a cache hit. The default list includes commonly used cache headers, and it is filterable to support e.g. additional cache headers used by specific vendors.

Note that due to the nature of this check it is only run in production environments.

Props furi3r, westonruter, spacedmonkey, swissspidy, Clorith.
Fixes #56041.

#12 @flixos90
2 years ago

  • Keywords needs-dev-note added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening this for the necessary dev note. It makes sense to cover this together with #56040 in a single dev note.

#13 @SergeyBiryukov
2 years ago

In 54044:

Site Health: Minor i18n cleanup in page cache and persistent object cache tests.

Includes:

  • Moving leading and trailing spaces out of a translatable string.
  • Using the established format for translator comments.
  • Using a consistent typography for the apostrophe.

Follow-up to [53955], [54043].

See #56041.

#14 @flixos90
2 years ago

Looks like there is a test in here that is sometimes failing, as seen in https://github.com/WordPress/wordpress-develop/runs/8125555737. We have been discussing this in https://wordpress.slack.com/archives/C02RQBWTW/p1661992665658499, potentially the problem is a timing issue with the data provider and when the test is executed (since the value there is set to 10 minutes later, but the test suite often takes longer than that). We can't reproduce that consistently, but will attempt setting it to HOUR_IN_SECONDS instead.

#15 @SergeyBiryukov
2 years ago

In 54045:

Tests: Increase the time difference for the expires header in Site Health page cache tests.

This aims to avoid a race condition in the Code Coverage Report, which takes longer than 10 minutes to run, and by the time the page cache test runs, the expires header that is supposed to be in the future is already in the past.

Follow-up to [54043].

Props Clorith, davidbaumwald, flixos90, desrosj, SergeyBiryukov.
See #56041.

@costdev
2 years ago

Fixes the @return type for the 'site_status_page_cache_supported_cache_headers' filter and uses str_contains() (polyfilled in WP 5.9)

#16 @costdev
2 years ago

On my travels, I noticed that the documented @param for the 'site_status_page_cache_supported_cache_headers' filter was int, but should be array.

Also suggest using str_contains() (polyfilled in WP 5.9) instead of false !== strpos() for readability.

#17 @costdev
2 years ago

Also just a brief heads up: A run of Tests_Site_Health::test_object_cache_default_thresholds() failed on an unrelated PR. This might've been a blip, but just drawing attention to this in case it needs more investigation.

Last edited 2 years ago by costdev (previous) (diff)

#18 @SergeyBiryukov
2 years ago

In 54047:

Site Health: Some documentation and test improvements for WP_Site_Health:

  • Add a @coversDefaultClass annotation to address @covers ::get_test_page_cache" is invalid notices.
  • Rename data providers to start with the data_ prefix and match the test method names, for consistency.
  • Move data providers next to the test methods they are used in.
  • Move ::get_test_page_cache() closer to ::get_test_persistent_object_cache(), for a bit more predictable placement.
  • Fix a typo in ::get_test_persistent_object_cache() description.

Follow-up to [53955], [54043], [54044], [54045].

See #56041.

#19 @desrosj
2 years ago

Is the only thing remaining here a dev note? It's not clear if 56041.diff was in [54047]. If only the dev note remains, let's close this out ahead of beta 1 today and use the keyword to keep track of this.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


2 years ago

#21 @JeffPaul
2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

As discussed ahead of today's scheduled 6.1 Beta 1 release party (see the Slack link above), it was deemed that this ticket was good to be closed and if something other than a dev note is required it could be handled in a new ticket or reopen this ticket as necessary.

#22 @spacedmonkey
2 years ago

  • Keywords add-to-field-guide added

There is a draft of a dev note available here.

#23 @milana_cap
2 years ago

  • Keywords add-to-field-guide removed

#25 @westonruter
16 months ago

#54423 was marked as a duplicate.

Note: See TracTickets for help on using tickets.