locked
Refreshing Cached WebMethods RRS feed

  • Question

  • User-1245426334 posted

    Hey, everyone!

    I'm wondering if someone can help me out. Like, most people, we cache our WebMethods and in some of them, we programatically load JavaScript files.

    An issue we've found during development is that when we make amendments to the JS file, the server continues to load a cached version, which means it's not picking up the changes we made and usually causes things to break.

    On the WebMethod, we've set the cache to 30 minutes, but even commenting that out temporarily doesn't fix this issue, nor does clearing the browser's cache.

    Does anyone have any ideas on how we can work around this?

    Thanks!

    -Eric

    Monday, November 11, 2013 11:06 AM

Answers

  • User-488622176 posted

    See http://forums.asp.net/t/1685214.aspx

    Either change the way javascript files are loaded & cached, either change the browser settings to never cache.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 12, 2013 8:15 AM
  • User-742633084 posted


    Hi airic82,

    For the caching you mentioned, are you using the standard HTTP cache or ASP.NET caching function? For standard HTTP caching, we can always invalid it by adding a dummy querystring parameter in the request url such as :

    http://server/app/service.svc?dummy=123456

    For ASP.NET server-side caching, you need to check how you define its refreshing or expire logic to make sure it will invalid/refresh whenever the certain condition occurs.

    Also, I'd suggest you use fiddler or some other HTTP sniffer tool to inspect the HTTP request/response data to see if the response from server does match the expected caching behavior.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 13, 2013 3:08 AM

All replies

  • User-488622176 posted

    See http://forums.asp.net/t/1685214.aspx

    Either change the way javascript files are loaded & cached, either change the browser settings to never cache.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 12, 2013 8:15 AM
  • User-742633084 posted


    Hi airic82,

    For the caching you mentioned, are you using the standard HTTP cache or ASP.NET caching function? For standard HTTP caching, we can always invalid it by adding a dummy querystring parameter in the request url such as :

    http://server/app/service.svc?dummy=123456

    For ASP.NET server-side caching, you need to check how you define its refreshing or expire logic to make sure it will invalid/refresh whenever the certain condition occurs.

    Also, I'd suggest you use fiddler or some other HTTP sniffer tool to inspect the HTTP request/response data to see if the response from server does match the expected caching behavior.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 13, 2013 3:08 AM