locked
how to clear browser cache of this same aspx page with JS RRS feed

  • Question

  • User-775831949 posted

    I have a aspx page full of JS.

    It is working fine except I found user browser remember this same url and the next hour when they load the same page the old stuff is still there even the external js is changed etc.

    Maybe due to my aspx and code behind didnt change so the browser pull the same old cache...

    Is there a C# or js code to force clear cache each time even it is just reload for this same aspx page name ?

    Pls help, thanks

    Thursday, September 21, 2017 5:29 AM

All replies

  • User-1508012637 posted

    Hi hkbeer,

    Is there a C# or js code to force clear cache each time even it is just reload for this same aspx page name ?

    Based on my knowledge, Javascript cannot used to clear the cache. And the common way is to append the revision number or updated timestamp to the file like below:

    scriptfile.123.js

    Or

    scriptfile.js?updated=1234567890

    If you have any other questions, please feel free to contact me any time.

    Best Regards
    Velen

    Thursday, September 21, 2017 6:16 AM
  • User-775831949 posted

    Is there other way to do this ? Thanks

    Tuesday, September 26, 2017 7:40 AM
  • User-1508012637 posted

    Hi hkbeer,

    The cache you mentioned above is kept by bowser so it cannot be cleared via C# or JavaScript code except that the user clear the browser cache manually.

    If you have any other questions, please feel free to contact me any time.

    Best Regards
    Velen

    Tuesday, September 26, 2017 9:30 AM
  • User1609405870 posted

    Hi, I see your example, now how to generate and put this append ramdom ?

    Friday, May 14, 2021 5:32 PM