admin管理员组

文章数量:1335175

Wordpress beginner here with a probably easy problem, yet I don't know how to do it. I want to disable caching on certain pages of my site.

I best describe what I do:

  • I have written a plugin in php
  • the php files (among other things) create a html that I insert via shortcode into a WP page
  • this html does use some javascript files - a leaflet map to be precise
  • on my site, the users can create such leaflet maps (on one page) and show them to the world (on another page)
  • Now when the user changes something on the authoring page, it is (most of the time) not shown on the audience page unless the user clears the cache.

I tried adding a random key to the .js file like this <script src="test.js?random=<?php echo uniqid(); ?>"></script> but it does not work.

I think I need to use some these hooks I keep hearing about, but I have no clue how.

If you want to see it in action, you can take a look at an audience page here or go ahead, make an account and test see the whole workflow.

本文标签: phpHow do I disable cache for a certain page