Unlike mobile applications, a web browser doesn’t allow to clear its cache memory. Though we cannot clear all cache of the client browser it is still possible to load the webpage without caching by using meta tags in the HTML code.
The only way to do this is by making few changes in the code which says the browser not remember the recently loaded memory which is nothing but the chache memory.
The following are two examples that explain
NOTE: The following codes cannot be run as it is and does not have an output. It has to added to an already existing code to see the Outputs.
Add this part of HTML code which makes the browser to not record the cache memory.
Appending a parameter to the filename in the script tag. Change it when the file changes.
Let this be the name of the file. Every time you load this page just change the version of the script.
The next time you load this page it should be something like this.
- A browser is designed in such a way that it saves all the temporary cache.
- It is so because cache memory is the main reason for the website to load faster.
- Hence there is no direct way to permanently delete it’s cache memory unless certain codings are changed in your HTML code.
- There may be few other ways to achieve this, but these two are the easiest and most effective one.
- How to clear APC cache entries using PHP ?
- fc-cache command in Linux with Examples
- Python - LRU Cache
- HTTP headers | cache-control
- Why does SASS cache folder is created ?
- How to clear the canvas using clearRect in HTML ?
- what happens when you don't free memory after using malloc()
- multimap clear() function in C++ STL
- HTML | DOM console.clear() Method
- PHP | Imagick clear() Function
- PHP | Ds\Collection clear() Function
- CSS | clear Property
- unordered_map clear in C++ STL
- ConcurrentLinkedDeque clear() method in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.