Thread Starter
loukky
(@loukky)
And anthoer issue happen..
as you can see,wp-statistics cache mode (v2 api)use url to record user·s IP ,Browser and others,now the page is cache,that means wp-statistics·s url can not chang when different visitor access same blog link,i dont know can you understand my “English”
-
This reply was modified 5 years, 3 months ago by
loukky.
Plugin Contributor
iSaumya
(@isaumya)
Hi @loukky,
I totally understand your point. But this is something we can’t fix and you need to talk to them. If they are using PHP to hardcode the URL parameters like you are saying then technically you can’t use any page caching as all will cause the same issue. Instead, they should use JavaScripts to dynamically get and push those data. You should talk to them about it.
But this problem will happen to you no matter what caching system you use as all caching systems will cache the page HTML.
Thread Starter
loukky
(@loukky)
Thank you for your reply,I think this thread has been resolved.
Plugin Contributor
iSaumya
(@isaumya)
Hi @loukky,
Good news. You can remove that htaccess code and instead add the following in your theme’s function.php:
// Send No Cache header for Rest API endpoints /wp-json*
add_filter( 'rest_send_nocache_headers', '__return_true' );
This will stop the WP JSON endpoints from being cached. Enjoy. 🙂 Will will add this feature in the upcoming release. For now, just add it to functions.php after the upcoming update you can enable it from the plugin settings.
Full credit to @timothyblynjacobs for pointing that out here: https://core.trac.ww.wp.xz.cn/ticket/52636#comment:4
-
This reply was modified 5 years, 3 months ago by
iSaumya.