2022年1月25日星期二

How to prevent caching of my js & json file? (no cache)

 <script src="test.js?version=1"></script>


<script src="test.js?random=<?php echo uniqid(); ?>"></script>

EDIT: Or you could use the file modification time so that it's cached on the client.

<script src="test.js?random=<?php echo filemtime('test.js'); ?>"></script>

沒有留言:

發佈留言

image img vertical text align center

  < div > < img style = "vertical-align:middle" src = "https://via.placeholder.com/60x60" alt = "A gr...