SUBSCRIBE TO OUR BLOG

    The 304 status code, also known as “304 Not Modified”, is an HTTP response indicating that the requested resource has not changed since it was last accessed. When a browser requests a webpage or resource that was previously cached, the server can respond with a status HTTP 304 to tell the browser to use its cached version instead of downloading the same content again. 

    This helps reduce bandwidth usage and improves loading times. The HTTP 304 status code is not an error but rather a way to optimise web performance through efficient caching.

    What Causes the Status Code 304 

    Several conditions trigger a 304 error response from the server. The most common scenario occurs when a browser makes a conditional request using either the “If-Modified-Since” header (containing the last modification date of the cached resource) or the “If-None-Match” header (containing the ETag of the cached version). 

    If the server determines that the resource has not been modified since the specified date or the ETag matches the current version, it returns a 304 status code. This happens frequently with static resources like images, CSS files, and JavaScript files that don’t change often. 

    The server configuration, caching policies, and browser settings all play a role in determining when a statuscode 304 is issued.

    Example 

    Here’s a simplified example of a 304 Not Modified response:

    Request:

    GET /styles.css HTTP/1.1
    
    Host: example.com
    
    If-Modified-Since: Wed, 15 Jan 2025 14:00:00 GMT
    
    If-None-Match: "abc123"
    

    Response:

    HTTP/1.1 304 Not Modified
    
    Date: Wed, 08 Jan 2025 15:00:00 GMT
    
    ETag: "abc123"
    
    Cache-Control: max-age=3600
    

    In this example, the browser requests styles.css and includes the last modification date and ETag from its cached version. Since the server determines the file has not changed, it responds with an HTTP 304 status code, telling the browser to use its cached copy instead of downloading the file again.

    Reseller Club Hosting Services

    Reseller Hosting | Windows Reseller Hosting | Cloud Hosting | VPS Hosting | Managed VPS Hosting | Dedicated Server Hosting | Windows Dedicated Server | Managed Dedicated Server | Linux Shared Hosting | Windows Shared Hosting