Not Modified Response, Caching Optimization and Output Caching Feature in IIS by info.odysseyx@gmail.com September 16, 2024 written by info.odysseyx@gmail.com September 16, 2024 0 comment 3 views 3 introductionCaching plays a vital role in optimizing web performance. When you enable output caching for a specific file extension or URL in IIS, you will receive a 304 Not Modified status code. This status code is essential for managing caching because it indicates whether the resource has been modified since it was last requested. How it works The 304 Not Modified status code indicates that a conditional GET or HEAD request was made and that the resource would have received a 200 OK response if the specified condition had not evaluated to false. Essentially, this means that the server does not need to send the resource again because the client already has a valid copy. In effect, the server instructs the client to use the cached version as if it had received a 200 OK response. When the server sends a 304 response, it must include the headers that would have been sent with a 200 OK response, such as . • Content-location, date, ETag and variety • Cache control and expiration For demo purposes, the site was hosted on IIS with output caching enabled for the .js extension. While browsing the site, you’ll notice that requests for .js files return a 304 Not Modified status code, and the server sends an ETag that matches the request header If-None-Match. Since the purpose of a 304 response is to minimize data transfer when the client already has a cached version, the server does not include any metadata other than required fields that are not needed for cache management. conclusionThe HTTP 304 Not Modified status code is used for web caching and performance optimization. It informs the client to use an existing cached copy, assuming that the conditional catch conditions specified in the request header can be verified. References HTTP Status Codes Overview – Internet Information Services | Microsoft Learn RFC 9110 – HTTP Semantics (ietf.org) Source link Share 0 FacebookTwitterPinterestEmail info.odysseyx@gmail.com previous post High Memory Usage or Memory Leaks in Web Applications: Identification and Log Collection next post Office LTSC 2024 is now available You may also like From Zero to Hero: Building Your First Voice Bot with GPT-4o Real-Time API using... October 12, 2024 A Guide to Responsible Synthetic Data Creation October 12, 2024 Capacity Template – MGDC for SharePoint October 11, 2024 Using Azure NetApp Files (ANF) for data- and logfiles for Microsoft SQL Server in... October 11, 2024 Microsoft Community – Do you love stickers?! Do you want to be a part... October 11, 2024 Advanced Alerting Strategies for Azure Monitoring October 11, 2024 Leave a Comment Cancel Reply Save my name, email, and website in this browser for the next time I comment.