none
clientCache causing 500 error on application hosted in Azure RRS feed

  • Question

  • Hello,

    I have an application which when deployed to dev and test (In Azure), the client cache on js files is not working for what seems like an undefined duration after deployment. Client caching works as expected locally. It just doesn't work on Azure. Inexplicably, caching starts to work after anywhere from 12 to 24 hours. This application is rebuilt and deployed to these environments almost constantly and client caching is necessary to pass performance stories through QA. I've tried to add the following config to the web.config...

          <staticContent>
              <clientCache cacheControlMode="UseExpires" httpExpires="Mon, 01 May 2023 00:00:00 GMT" />
          </staticContent>

    With the above config both dev and test return a 500. As a disclaimer (which I'm not sure if it matters or not), we are using require.js over bundling and we are not using any of the optimization features (yet). Is there something that I am missing, that will one, get the above script to work, or better two, get the application to pass the expiration headers in the first place?

    Any help would be greatly appreciated, I've been looking at this issue for over a month now.



    • Edited by Eric Haltom Wednesday, October 2, 2019 6:24 PM Verbosity
    Wednesday, October 2, 2019 5:26 PM

All replies

  • Hi Eric,

    Welcome to the MSDN forum.

    According to your description, we could not directly find out the reason why your client-cache causing 500 error.

    Could you please share the details error message about the 500 error?

    Could you please tell me which azure service you have used? Azure App service or Azure VM?

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, October 3, 2019 2:33 AM
    Moderator
  • So I have been able to figure out the caching issue in general. Our Azure environment had the WEBSITE_LOCAL_CACHE_OPTION setting set to off. Once the architect fixed that caching worked as expected which in turn negates our need for the above configuration added to our web.config.

    But to answer your question, we are running on Azure serverless environments. I'm not privy to the specifics of exactly which services.

    I did find out we are using MS support premium and that's how I found out the setting to look for in our Azure configuration. He also verified that the code that we used in our web.config did not cause a 500 on his end, so I am still unaware of why that is happening, but I really don't need it at this point so for me, all is good.

    If you would like further details on this subject for future questions, I'll be happy to provide them.

    Thank you!

    Eric Haltom

    Thursday, October 3, 2019 6:10 PM
  • Hi Eric,

    Thanks for your sharing and we are so glad to hear that your issue is solved. 

    BTW, please mark your reply as answer and that will help other community members to easier search this helpful information, we can also close this thread for you, thanks for your understanding.

    If you have any more ASP.NET development issue in the future, we can seek for a better support from this appropriate forum: https://forums.asp.net/

    Best regards,

    Sara


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, October 4, 2019 2:51 AM
    Moderator