Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#54499 closed defect (bug) (fixed)

REST API: Use global transients for URL details endpoint.

Reported by: peterwilsoncc's profile peterwilsoncc Owned by: audrasjb's profile audrasjb
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: REST API Keywords: has-patch has-unit-tests commit
Focuses: performance Cc:

Description

The WP_REST_URL_Details_Controller caches the results of a URL request for 60 minutes in the set_cache() method, it in turn calls the set_transient() function.

As it's safe to assume the requested URL will return the same output regardless of the site requesting it, global transients can be used with get_site_transient() and set_site_transient().

Change History (5)

#1 @hellofromTonya
3 years ago

  • Milestone changed from Awaiting Review to 5.9

Pulling this into 5.9 as URL Details endpoint is introduced in 5.9.

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


3 years ago

This ticket was mentioned in PR #2000 on WordPress/wordpress-develop by costdev.


3 years ago
#3

  • Keywords has-patch has-unit-tests added; needs-patch removed

#4 @audrasjb
3 years ago

  • Keywords commit added
  • Owner set to audrasjb
  • Status changed from new to assigned

Thanks @costdev, the PR looks good to me.
Self assigning for commit consideration.

#5 @audrasjb
3 years ago

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

In 52311:

REST API: Use global transients for URL details endpoint.

Follow-up to [51973].

Props peterwilsoncc, costdev.
Fixes #54499.

Note: See TracTickets for help on using tickets.