[wp-trac] [WordPress Trac] #57088: Rest API improve time response with cache

WordPress Trac noreply at wordpress.org
Sat Nov 12 12:29:54 UTC 2022


#57088: Rest API improve time response with cache
--------------------------+----------------------------------------
 Reporter:  emanuelx      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  6.1
 Severity:  normal        |   Keywords:  needs-dev-note 2nd-opinion
  Focuses:                |
--------------------------+----------------------------------------
 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?

 3. 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

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57088>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list