Posts that are served through caching plugins like batcache bypass disable_nr_autorum()
logic
#10
Labels
Milestone
disable_nr_autorum()
logic
#10
I've noticed on a production site that posts which are retrieved through batcache seem to be getting New Relic's
<script>
tags embedded, in cases where it should be disabled.An example is AMP pages. On the initial page render, the action
pre_amp_render_post
action is fired, which causesdisable_nr_autorum()
to fire, preventing the New Relic browser scripts from being injected on the page.However, if that same page request is served through batcache, the appropriate action isn't fired, and New Relic scripts are inserted (in some cases, re-inserted) into the HTML markup retrieved from memcache.
This may not be an issue that can be easily fixed in this plugin, but I wanted to open an issue here to track progress on it. It may be possible to output a special
vary_cache_on
function if batcache is detected. If not, and this is something that needs to be fixed with a special nginx directive or a function in the wp-config file, it would be good to at least have it documented here. Perhaps we can show example code that users can copy into their webserver configuration in an admin notice or help page?The text was updated successfully, but these errors were encountered: