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
版权声明:本文标题:php - How do I disable cache for a certain page? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742343073a2456988.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论