What is “304 Not Modified” status code and how to fix it

When you enter a URL in your browser, it sends an If-Modified-Since request header to the web server to determine when the web page was last modified.

Then, the Last-Modified response header specifies the time. If there has been no change, the server will send the HTTP 304 response code.

The HTTP status code 304 signifies Not Modified, indicating the server found no changes in the requested page since your last visit.

Your browser will retrieve the cached version of the web page in your local storage. That way, the browser doesn’t have to download the same information from the website’s server repeatedly.

5 methods to fix the 304 status code

There are five ways to fix the “304 Not Modified” status code. Even though you cannot solve the problem on the client side, you can recommend possible solutions.

1. Clear your browser cache

You can start by deleting all your browsing data, cookies, and other cached information.

Clearing your browser’s cache will remove all data in your temporary storage. By clearing it regularly, you’ll save plenty of disk space and enable it to work faster.

Outdated resources in your cache can also stop you from seeing the website’s updated content. Clearing them lets you get a new copy of information from the site’s web server.

If you’re using Google Chrome, follow these steps to clear your browser’s cache:

  1. Click Customize and control Google Chrome – the three horizontal dots at the top-right corner of your window.
  2. Navigate to History -> History.
  3. Click Clear Browsing Data.
Clearing browser data on Google Chrome.
  1. A new window will pop up. Select the Time range. Iif you want to clear up everything, choose All Time.
Choosing to clear browsing history, cookies and other site data, cached images and files of all time.
  1. Choose what you want to clear – browsing history, cookies and other site data, cached images and files.
  2. Click the Clear Data button.

If you use another browser, the steps to clear the browser cache will vary. However, we provide a step-by-step cache-clearing guide for different desktop and mobile platforms.

2. Flush the DNS

Similar to web browsers, operating systems also store cache files, but in the Domain Name System (DNS) cache. It contains information about your browsing data, including hostnames, IP addresses, and resource records.

DNS caching helps load web pages faster when you visit them again, lessening the DNS server’s burden when traffic is high.

The cache files have a validity period, which is determined by the Time to Live (TTL) value. Valid DNS caches can answer any content request without going through a DNS server. However, they can cause errors or security issues if they’re outdated or corrupted.

Regularly flushing your DNS can improve your operating system’s security and prevent search behavior tracking, making it hard for hackers to predict your browsing history.

It can also solve technical problems, such as connection issues or the HTTP “304 Not Modified” response codes.

If you use Google Chrome, flush your DNS by entering chrome://net-internals/#dns into the address bar.

Flushing DNS on Google Chrome.

A menu page will open. Click the Clear host cache button.

Google Chrome keeps a separate DNS cache, so it is necessary to flush DNS on your computer as well.

Flushing your operating system’s DNS is also relatively simple. Follow the steps below if you use Windows – it’s applicable for Windows XP, 7, Vista, 8, 8.1, or 10:

  1. Click the Start button, then navigate to Windows Systems -> Command Prompt.
  2. The command-line interface will open. Type this command line:

ipconfig /flushdns

  1. A confirmation message will appear once the process is successful.

Flushing your DNS on other operating systems, such as Mac and Linux, is also possible.

3. Check your redirect instructions in .htaccess

If none of the previous methods corrected the error message, the issue may be on your server configuration file. For example, your redirect instructions may be incorrect.

To check your server configuration file, you need to know whether your server is running on NGINX or Apache.

If you use NGINX web server, you don’t have access to the .htaccess file. Check the error logs to see what you need to troubleshoot.

With Apache, check the .htaccess file in your site’s root directory. Log into your hosting account’s File Manager, then navigate to the public_html folder.

Disable the .htaccess by renaming it to .htaccess_disabled. Check the site’s availability and the “304 Not Modified” status code while the .htaccess is disabled. Rename it back to .htaccess to enable it again.

If this method resolves the error code, check the code in the .htaccess with your developer. Also, look for incorrect redirect settings, which differ on each website.

4. Run a malware scan

Another possible cause of the HTTP “304 Not Modified” status is a browser corrupted by a virus or malware infection.

Those threats may interrupt or interfere with your system, including the header request. To identify and remove the threats from your system, run a malware scan.

If you use Google Chrome on Windows, perform it by running the built-in Malware Scanner and Cleanup Tool.

First, check if your Chrome is up to date. Click on the three vertical dots on the top-right of Chrome’s window, then navigate to Settings -> About Chrome.

About Chrome window informing that Google Chrome is up to date.

If you’re not using Chrome’s current version, update it by clicking the Relaunch button.

Now that you’ve updated Chrome, open a new tab and enter chrome://settings/cleanup on the URL bar. Click Find.

Clicking on the find button to find harmful software.

It will immediately scan your computer and then provide you with the results report.

Other browsers, such as Mozilla Firefox and Microsoft Edge, don’t have a built-in malware scanner. The same goes for other operating systems, such as Mac and Linux.

If you use these browsers or operating systems, run the malware scan with the antivirus software on your computer.

5. Disable browser extensions

Infected browser extensions can also interfere with requests and server communication, causing the HTTP “304 Not Modified” status code.

Disable your browser’s extensions to solve this issue. The steps vary for each browser, so here is a guide for four major browsers – Google Chrome, Mozilla Firefox, Safari, and Microsoft Edge.

Chrome

Navigate to Settings -> Extensions. On the Extensions page, disable each extension by clicking on their toggle switches.

Disabling Google Chrome extensions.

Click the Remove button if you want to delete unused or outdated extensions.

Mozilla Firefox

  1. Click the Open menu icon on the top-right of your Mozilla Firefox window, then select Add-ons.
  2. On the Add-ons Manager tab, select Plugins.
Selecting Plugins on Mozilla Firefox.
  1. Choose the plugins that you want to disable by selecting Never Activate on the drop-down menu.
Disabling plugins by choosing never active.
  1. If you want to re-enable the plugin, check the Disabled plugins list and select Always Activate on the drop-down menu.
Re-enabling plugins by choosing always active.

Safari

  1. On Safari, open the menu and select Preferences.
  2. Click the Extensions icon.
  3. Deselect an extension’s checkbox to turn it off.
Extensions on Safari.
  1. If you no longer need an extension, it’s better to uninstall it. Click the Uninstall button to do so.

Microsoft Edge

Navigate to Settings and more on the top-right corner of the Microsoft Edge window. Select Extensions.

Extensions on Microsoft Edge.

Click on the extension’s toggle switch to disable it. It will erase the extension icon next to the address bar.

We recommend relaunching your browser once you finish disabling the extensions to get the best results. After that, check the URL that you initially wanted to visit. See if it still has the HTTP “304 Not Modified” status code.

If it resolves the issue, it’s safe to re-enable your extensions one by one.

What Are HTTP Status Codes?

HTTP status codes indicate information exchange. They let you know if the request you made was successful or if there was an error.

There are five categories of HTTP status codes, each indicating a different type of issue:

  • The 1xx status codes – informational requests.
  • The 2xx status codes – successful requests.
  • The 3xx status codes – redirects.
  • The 4xx status codes – client errors.
  • The 5xx status codes – server errors.

However, only a few of these codes you’ll likely encounter directly. If you ever come across any of these response status codes, it means you should take further action to solve the issue.

For example, response codes in the 400s indicate errors, such as the 403 Forbidden, which means you don’t have permission to access a resource.

Then, there are the 200s responses, such as HTTP 200 OK, communicating your request’s success.

Meanwhile, response codes in the 300s indicate redirection issues, such as the 301 and 302 redirects, used for permanent and temporary redirects.

HTTP 304 requests may improve user experience by speeding up resource page delivery, especially when you have a massive number of web pages.

It optimizes your user experience speed and minimizes the requests that the server has to handle. It also helps search engines crawl your pages more efficiently since they won’t waste their crawl budget on pages that haven’t been updated since their last visit.

However, it may also block the visitor’s access to your content.

What causes the “304 Not Modified” status code?

“304 Not Modified” status codes can happen either on the server or the client-side. However, if a user encounters a “304 Not Modified” status code on your site, the error most likely occurred on their part and there isn’t much you can do to fix it.

Here are some of the causes why a user may receive a 304 Not Modified status code:

  • Virus – The browser may be corrupted by viruses or malware, which affects its capability of communicating with web servers and caching web pages.
  • Recent software installation – If a user just recently installed or uninstalled software on their computer, sometimes the registry can become corrupt. This condition also impacts the browser’s communication and caching function.
  • Corrupt application – If a user has any application which has corrupt files related to their browser, it will impact its ability to save web pages and update information.
Hostinger web hosting banner

Conclusion

If you come across the HTTP “304 Not Modified” status code when accessing a website, it means your browser and the web server experienced a communication issue.

This status code can appear on both your side or your site visitors’ and might block access to your content.

The HTTP “304 Not Modified” status code indicates that there is no need to retransmit the resources you request – it will redirect you to cached content instead.

However, the 304 status code may also indicate that your browser or server is not configured correctly, causing issues in the communication between the two.

There are five methods you can follow to fix this issue:

  1. Clearing your browser cache
  2. Flushing the DNS
  3. Checking your redirect instructions in .htaccess
  4. Running malware scan
  5. Disabling the browser extensions

After performing each method, make sure to recheck everything by relaunching your browser.

Keep in mind that it is not possible to solve the “304 Not Modified” status code on your visitor’s side, but you can provide them with a resource to fix the error codes.

304 status code FAQs

Is the 304 status code bad?

No, a 304 status code is not bad. It is a response status code that indicates that the requested resource has not been modified since the last time it was accessed. It can help reduce bandwidth usage and improve page loading times by allowing cached resources to be reused.

How can I avoid getting a 304 status code error?

You cannot avoid getting a 304 status code error as it is not an error but a response indicating that the requested resource has not been modified. However, you can optimize your website’s caching policies to minimize unnecessary requests and reduce the likelihood of receiving a 304 response.

Author
The author

Nadia Maya Ardiani

Maya is a Content Specialist and WordPress Contributor. With years of journalistic experience under her belt, her main goals are to help people understand complex processes in a simpler way, and tell the stories of people who thrive thanks to technology. When she’s not writing, you can find her watching sci-fi movies while eating ramen. Follow her on LinkedIn.