locked
Clear cache in both browser and the server? RRS feed

  • Question

  • User1092566934 posted

    Hello, 

    Sometimes happens that when I update the web in server the changes are not refreshed in browser until the cache is not cleared (pressing F5 or Ctrl+F5). There are any special configuration in IIS or code behind which clear the cache and make me sure that the page requested is updated?

    Wednesday, June 18, 2014 5:41 AM

Answers

  • User724169276 posted

    server and client browser are different.Clearing the cache should be done by client browser , server has nothing to do with this.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 18, 2014 5:44 AM
  • User364480375 posted

    For Browser : Look into the cache-control and the expires META Tag.

    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

    <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">

    Another common practices is to append constantly-changing strings to the end of the requested files. For instance:

    <script type="text/javascript" src="main.js?v=12392823"></script>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 18, 2014 5:49 AM

All replies

  • User724169276 posted

    server and client browser are different.Clearing the cache should be done by client browser , server has nothing to do with this.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 18, 2014 5:44 AM
  • User364480375 posted

    For Browser : Look into the cache-control and the expires META Tag.

    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

    <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">

    Another common practices is to append constantly-changing strings to the end of the requested files. For instance:

    <script type="text/javascript" src="main.js?v=12392823"></script>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 18, 2014 5:49 AM
  • User1092566934 posted

    I need to control the cache, mike4u.

    It is really a complicated case, because I would only need refreshing the page when I perform an update in IIS and need to be sure that the user's browser is not displaying an old version of the webpage. But if you, Ashim Chatterjee, say that it only depends on client side, there are not much left to do, right?

    Tuesday, June 24, 2014 8:39 AM
  • User724169276 posted

    there are not much left to do, right?

    exactly, its client / end user's headache to clear the cache on timely fasion.you(server) cant do anything about this.

    Tuesday, June 24, 2014 8:41 AM
  • User1092566934 posted

    Ok, thanks.

    I will have to deal with it.

    Wednesday, June 25, 2014 2:13 AM
  • User724169276 posted

    Glad you got it :)

    Have a great day.

    Wednesday, June 25, 2014 2:16 AM
  • User543691468 posted

    Actually, you can control this. Check out ETag.

    http://forums.asp.net/t/1826687.aspx?Configure+ETags

    Friday, June 27, 2014 4:31 AM