[wp-trac] [WordPress Trac] #39861: WP REST API and Caching Issue
WordPress Trac
noreply at wordpress.org
Sun Mar 26 01:59:59 UTC 2017
#39861: WP REST API and Caching Issue
--------------------------+----------------------
Reporter: sckmkny | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: REST API | Version: 4.7.2
Severity: normal | Resolution: invalid
Keywords: | Focuses:
--------------------------+----------------------
Changes (by joehoyle):
* status: new => closed
* resolution: => invalid
* milestone: Awaiting Review =>
Comment:
@sckmkny is this for an authenticated request? We don't send no-cache
headers on anonymous requests, for example:
{{{
> http https://demo.wp-api.org/wp-json/wp/v2/posts
HTTP/1.1 200 OK
Access-Control-Allow-Headers: Authorization, Content-Type
Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages
Allow: GET
Cache-Control: max-age=300, must-revalidate
Connection: keep-alive
Content-Encoding: gzip
Content-Type: application/json; charset=UTF-8
Date: Sun, 26 Mar 2017 01:56:55 GMT
Last-Modified: Sun, 26 Mar 2017 01:56:55 GMT
Link: <https://demo.wp-api.org/wp-json/wp/v2/posts?page=2>; rel="next"
Server: nginx/1.4.6 (Ubuntu)
}}}
As for siteground returning the bogus last-modified, I don't know why they
would be doing that but I think that might be an issue on their end.
`cache-control:no-cache, must-revalidate, max-age=0` should absolutely not
cause a last modified to be that, so it might be better to reach out to
their support. We already send a last modified of the current date.
Going to close out, but re-open if it seems I missed something!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39861#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list