I had created a dynamic web page. On the main page there are three sliding images. I created another page to change that main page image (sliding). So after I submit that second page, I wrote a PHP code to go back to main page. But the images are not changing because my browser has that web page in its cache. If I remove cache manually, or restart the browser it is working. How I remove my browser cache in PHP coding? give me a solution. Thanks.
You may also add a random string to the image-URI:
<img src="myimage.png?r=12345" alt="">
If the random string varies every time the main page is reloaded (!), the browser will retrieve the image from the server.
There is one trick that can be used.The trick is to append a parameter/string to the file name in the script tag and change it when you file changes.
<script src="myfile.js?version=1.0.0"></script>
The browser interprets the whole string as the file path even though what comes after the "?" are parameters. So wat happens now is that next time when you update your file just change the number in the script tag on your website (Example <script src="myfile.js?version=1.0.1"></script>) and each users browser will see the file has changed and grab a new copy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With