How to ask browsers to refresh (flush) the cache of my website?


Tags: javascript,css,caching,browser,website

Problem :

I searched everywhere and I can only find solutions that I do not understand (I am not really skilled in web development).

If I understand correctly, the best method is the versionning of javascript and css calls. But I don't understand how I am supposed to implement this in my website or server.

Would someone have an idea or a link for a beginner like me? (the easiest method is the best for me I suppose)

Right now my users have problems with the website, but all problems vanish when the cache is cleared. It's a big problem.

Thanks anyway guys. Have a nice day.



Solution :

Simply add a new parameter to the end of the file every time you update it, eg

<script src="http://www.example.com/javascript.js?reload=1">

and

<script src="http://www.example.com/javascript.js?reload=2">

will both be treated as different files, despite actually being exactly the same..

If you need it never to cache, then change the parameter dynamically every page load using a script (adding a timestamp is the usual approach as that will never get accidental repeats).


    CSS Howto..

    How to change the opacity of image on hover using css

    How to use custom CSS to change the distance between the header and top of the page/where the page starts? [closed]

    How do I Align The Border Of Text To An Image? (HTML/CSS) | (Extra [Answered]): How do I Fullscreen with Inspect? |

    CSS - How to remove comments and make CSS one line

    How to hide a column in a DataGrid?

    How to avoid WebKit contentEditable copy-paste resulting in unwanted CSS?

    Flexbox: how to get divs to fill up 100% of the container width without wrapping?

    How to give css when span tag within double quotes

    How to remove space between columns in BluePrint CSS framework?

    How do I align a div at the bottom right corner of a web page even if the content is less?

    how to make
  • add css class active after refreshing page?
  • How Should I Send HTML/CSS Content To A Server?

    How do I inline the :before element when unable to include a CSS/style section?

    CSS: How to set hover effect on menu-item when submenu-item is displayed

    How can I create an overlay that stays in DOM as opacity 0 but doesn't prevent content from being clickable?

    How can I arrange for a horizontal scroll bar on overflow with flexbox items?

    How to manage text breaks in span using js, css or anything else

    how to to set chat box based on user id using css

    How to create Chrome DevTool style bar charts with grids using plain CSS/HTML?

    HOW to combine two element that has different parent in CSS? [duplicate]

    How to hide a