Make WordPress Core

Opened 22 months ago

Last modified 22 months ago

#57088 new defect (bug)

Rest API improve time response with cache

Reported by: emanuelx's profile emanuelx Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: REST API Keywords: needs-dev-note 2nd-opinion
Focuses: Cc:

Description

Hi, again :)

I'm developing wordpress websites but only using the rest api, as Headless CMS.

I've blocked the frontend, and created custom endpoints to be consumed by a React application.

So, more than a year pass and I'm consumed by an issue on my websites, the rest api it's little slow like 300ms-1000ms of time response this is a lot.

As I know, I can cache the responses using transient api, I've tried that, but without success.

What is the best solution to avoid database access?

  1. Should I create a wp-content/object-cache.php and cache the responses of endpoint?

2.Advanced-cache.php can help me to improve the response time of rest api?

  1. do we have a method/hook/filter to check if cache exist before WordPress load everything /plugins/themes etc...? For example on https://developer.wordpress.org/reference/hooks/request/ and this hook, returns the response from cache without having to load every file from WordPress.

I tried some cache plugins, but doesn't improve the speed?

Any example to do this correctly, to improve the rest api time and database overload.

Thanks

Change History (1)

#1 @johnbillion
22 months ago

  • Version 6.1 deleted
Note: See TracTickets for help on using tickets.