[wp-trac] [WordPress Trac] #52636: Add proper Cache-Control header to /wp-json REST endpoints
WordPress Trac
noreply at wordpress.org
Wed Feb 24 06:45:29 UTC 2021
#52636: Add proper Cache-Control header to /wp-json REST endpoints
-------------------------+------------------------------
Reporter: isaumya | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: major | Resolution:
Keywords: needs-patch | Focuses: rest-api
-------------------------+------------------------------
Comment (by isaumya):
Hi @TimothyBlynJacobs,
Thanks for looking into it. The reason it shouldn't be cached is let's
imagine that you are creating an app or something which fetches the data
from the API to show in the app or something like that. Now if the API
endpoints are cached in a CDN then that app will only show the data that
it gets from the cached endpoints. Moreover, if the data is cached and you
add/update something inside your website and then inside Gutenberg, you
are trying to add a hyperlink or find something which is not present in
the cached content, this might lead to an issue.
It is kind of the same reason sitemaps shouldn't be cached so that it
always gives the latest and most updated content. Only the things that get
rarely changed like static pages, posts etc. should be cached. Do you feel
otherwise?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52636#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list