Azure web app does not return not modified (304) when it should

2022-09-24T10:14:34.817+00:00

Etag and if modified since are sent correctly for a Js file .. still azure web app always returns 200 instead of 304.
How is that ? It works on iis

Developer technologies ASP.NET ASP.NET Core
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,931 questions
Developer technologies ASP.NET Other
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2022-09-29T10:21:37.357+00:00

    Thanks for the follow-up. Apologies for any confusion. The HTTP status codes 3xx – denotes Redirection. I was just sharing samples for Redirection, in general.

    Just to clarify:
    You have stated it works locally/on IIS, could you please share more details about your application framework/config?
    How exactly are you reviewing HTTP code, via Fiddler or browser F12?
    do you see fail to get the new code based on If-modified-since or ETAG. Does force refresh on browser - CTRL + F5 to force a download, shows any different behavior?

    Typically, with 304 - The client browser requests a document that is already in the cache. And the document hasn't been modified since it was cached. The client browser uses the cached copy of the document instead of downloading the document from the server.

    See if this works, Bundle Caching |
    BundleTable.EnableOptimizations = true

    Could you please check Failed request tracing and Web server logging to fetch more info. See troubleshoot-diagnostic-logs for the steps.

    -- For detailed analysis on this, could you please share your WebApp name here or I’ll follow-up privately on this.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.