spinupwp / wordpress-nginx

Nginx server configurations for WordPress
609 stars 181 forks source link

WP JSON #10

Closed NTShop closed 7 years ago

NTShop commented 7 years ago

You should update to not cache URLs that lead to /wp-json

if ($request_uri ~* "/wp-admin/|/wp-json/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") { set $skip_cache 1; }

A5hleyRich commented 7 years ago

Thanks, fixed in 1530e8c2be5a420

raqqun commented 7 years ago

I can't understand why wp-json have to be skiped. For all i know wordpress api is a public interface of wordpress much like the website itself. Why not assume that the same principles of caching apply to that endpoint too ?

A5hleyRich commented 7 years ago

I think it's safer to not cache data endpoints by default as it can cause unexpected behaviour.