Bobcares

How to fix 304 not modified error

by | Sep 14, 2020

The HTTP 304 not modified error is a status code that indicates that that the requested resource has not been modified since the previous transmission.

As a part of our Server Management Services, we help our Customers to fix HTTP related errors regularly.

Let us today discuss the possible causes and fixes for this error.

What is 304 not modified error?

The 304 error indicates a communication problem between a user’s browser and server.

This message tells the browser that the resources cached in the browser have not been modified since the previous transmission. Thus there is no need to retransmit the requested resource to the client again. As a result, the browser displays a cached version of the web page.

Sometimes, this status code is shown when if it is not supposed to return this result. It can happen in the following cases:

  • Server configuration or Domain Name Server (DNS) issues
  • Infected or corrupted cached resource

 

How to fix the 304 not modified error?

Let us now look at some potential measures that may help us to resolve this error message.

Check server configurations and redirects

The 304 response codes could trigger due to incorrect redirect instruction present in the server configuration. For the Apache web server, it would be a good idea to cross-check the redirect rules in the .htaccess.

Check for the line starting with “mod_cache” in this file.  We can try commenting out those lines to see if it fixes this error. Also, look for similar redirect codes in the Apache configuration file under mod_cache.c section like the one given below:

LoadModule cache_module modules/mod_cache.so
<IfModule mod_cache.c>
    LoadModule cache_disk_module modules/mod_cache_disk.so
    <IfModule mod_cache_disk.c>
        CacheRoot "c:/cacheroot"
        CacheEnable disk  "/"
        CacheDirLevels 5
        CacheDirLength 3
    </IfModule>

    # When acting as a proxy, don't cache the list of security updates
    CacheDisable "http://security.update.server/update-list/"
</IfModule>

 

For Nginx websites, look for the expires directive within the nginx.conf file. This define when the cached versions should be refreshed from the server. A sample one looks like:

map $sent_http_content_type $expires {
    default                    off;
    text/html                  24h;
    text/css                   24h;
    application/javascript     max;
    ~image/                    max;
}

server {
    listen 80;
    listen 443 ssl;
    server_name www.example.com;
    expires $expires;
}

We could temporarily disable this directive by commenting out those lines.

Using a Public DNS

The 304 error can happen due to an incorrect DNS address. Thus a possible method to fix this error would be to use the Google Public DNS.

On Windows, we can perform it from the Network connections window. Here, locate the network connection you’re using and right-click on it.

Next, select Properties and double-click on Internet Protocol Version 4.

Select the option to “Use the following DNS server addresses”, then enter the value “8.8.8.8” under Preferred and “8.8.4.4” under Alternate. Finally, we need to restart the system to apply the changes.

Sometimes, flushing the DNS cache can help also help us to fix this error

Perform a malware scan

Corrupted browsers are another common factor that may trigger this error. Thus it is recommended to run a malware scan on the browser if we unexpectedly receive the 304 status code.

Windows version of Chrome has a Malware Scanner and Cleanup Tool that comes built-in. The cleanup can be performed from the URL “chrome://settings/cleanup”.

Hit Enter, and then next to Find and remove harmful software click on the Find button. The scanner will begin running, then report back with the results.

For other browsers, we may use an antivirus program in the server to perform the scan as they do not have an inbuilt one.

It is possible for the browser’s extensions to become infected and interfere with requests and server communication. Thus we could also try disabling them to see if it fixes the error.

We could also try clearing the browser cache as it helps us to sort out this problem at times.

Debug Application Code

Another possible reason for this error is some custom code within the application. We may need to manually debug the application, along with parsing through application and server logs.

[Need any further assistance in fixing HTTP errors? – We’re available 24*7]

 

Conclusion

In short, HTTP 304 not modified error is a status code that indicates that that the requested resource has not been modified since the previous transmission. Today, we saw how our Support Engineers fix this error.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.