The HTTP 304 not modified status code indicates a communication problem between a user’s browser and a website’s server. If you or your users come across this status code on your site, it can block access to your content entirely.
Since it can be on the server-side or the client-side, figuring out the source of the problem can take a little work. Fortunately, there are several foolproof techniques for troubleshooting it.
In this post, we’ll discuss HTTP status codes and explain what the HTTP 304 status code is. Then we’ll walk you through six methods you (or your visitors) can use to fix it.
Let’s get started!
An Introduction to HTTP Status Codes
To understand HTTP 304, it helps to first understand status codes. Put simply, every time you make a request to your browser – such as by accessing a particular website – an HTTP status code is sent between your browser and the server in order to exchange information.
There are more than 40 different status codes that can be involved in that communication. However, there are only a handful you’ll likely come across directly. When you do encounter a status code, it usually means that something has gone wrong.
HTTP status codes fall into one of five categories, numbered between the 100s and 500s. Each series indicates a different type of problem. For example, error codes that fall into the 400s, such as the “404 Not Found” error and the ”401 error”, typically mean that there was an issue with the request and the website or page in question was unreachable.
On the other hand, codes in the 300s – such as the HTTP 304 status code we’ll focus on in this post – are redirection codes. They make it clear that the information being requested was either temporarily or permanently substituted with another resource.
When you encounter one of these status codes, it means that further action must be taken.
What is The HTTP 304 Status Code?
HTTP 304, also sometimes known as “304 Not Modified”, is a code that communicates to your browser that: “The requested resource has not been modified since the last time you accessed it.”
The Internet Engineering Task Force (IETF) defines the 304 Not Modified as:
The 304 (Not Modified) status code indicates that a conditional GET or HEAD request has been received and would have resulted in a 200 (OK) response if it were not for the fact that the condition evaluated to false. In other words, there is no need for the server to transfer a representation of the target resource because the request indicates that the client, which made the request conditional, already has a valid representation; the server is therefore redirecting the client to make use of that stored representation as if it were the payload of a 200 (OK) response.
Essentially, your (or your visitor’s) browser is being told by the server that the resources stored (cached) in the browser haven’t been modified since the latest time you visited that page.
In turn, your browser retrieves a saved version of the web page from the cache. The purpose of this is to improve page speed and delivery, by preventing your browser from having to repeatedly download the same information.
Understanding HTTP 304 Requests
When your browser stores a resource in the cache, it keeps what’s called the ‘Last-Modified header’ information that was sent from the server. If a browser receives a request for a web page it has a saved copy of, but it doesn’t know whether it has the latest version, it sends a ‘conditional validation’ request to the server.
The browser communicates to the server the ‘Last-Modified’ date and time for the copy of the resource it has, via the ‘If-Modified-Since’ or ‘If-None-Match’ header. The server inspects these headers and also looks at the ETag value. The latter is a unique identifier used to specify the version of a particular resource.
If the values for these files are the same, the server sends the HTTP 304 Not Modified response header and the browser uses the cached copy of the resource.
If the browser copy is outdated, meaning that the file has been modified since the last request, it sends an HTTP 200 code and a new copy is used.
Unfortunately, there are a few issues that might cause an HTTP 304 response when it’s not supposed to occur. The most common causes include:
- Server configuration or Domain Name Server (DNS) issues
- A cached resource that is infected or corrupted (i.e., malware or viruses affecting the browser)
The 304 status code can be due to a problem on either the server-side or the client-side, so it might take some troubleshooting in order to diagnose and resolve it.
How to Fix an HTTP 304 Status Code (6 Potential Methods)
The methods you can use to resolve an HTTP 304 status code vary from simple to fairly technical. Search engines are responsible for indexing and caching websites, so this issue can usually be traced back to the browser being used to access the site.
Of course, there’s only so much you can do to fix the browsers of people who are trying to access your site.
However, understanding what may be causing the issue for visitors can be helpful, either when trying to find a solution on your end or assisting them directly.
With that in mind, let’s take a look at six methods you can use to try and fix an HTTP 304 status code!
1. Clear the Browser’s Cache Data
First up, cleaning your browser data to clear the cache might help with accessing the desired URL. This includes deleting all of the browsing data, cookies, and cache information.
The instructions for executing this process will vary depending on the browser you’re using. If you’re unsure how to do it on your device, feel free to refer to our guide on clearing the cache for all major browsers.
2. Run a Malware Scan
Corrupted browsers that have been infected with a virus or malware may be another culprit. Therefore, it’s a good idea to run a malware scan on your system. Doing so can help identify and remove any issues that might be interrupting or interfering with the header request, including problematic extensions.
If you’re using the Windows version of Chrome, you can run the Malware Scanner and Cleanup Tool that comes built-in.
To do this, first make sure you’re running the latest version of Chrome by opening up a new tab and clicking on the menu icon, followed by About Chrome:
If your browser isn’t updated to the current version, you can resolve that in the same place. Then, open a new Chrome tab and enter “chrome://settings/cleanup” into the URL bar.
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.
Unfortunately, some other browsers such as Firefox and Edge, as well as the macOS and Linux OSs, do not come with their own versions of this built-in tool. Instead, you’ll have to run a malware scan using the antivirus software on your computer.
3. Disable Your Browser’s Extensions
Your browser’s extensions may also become infected and interfere with requests and server communication. That’s why you may also want to disable them. You can do this by opening Chrome’s menu and going to Settings > Extensions:
On the Extensions page, you can disable each one by clicking on the corresponding toggle switch.
You can also delete unused or outdated extensions via the Remove button:
Again, this process will vary slightly depending on your browser. The goal is to remove or disable each extension manually and then check to see if that resolves the HTTP 304 issue.
Then, you can try turning them back on one by one.
4. Flush the DNS and Reset the TCP/IP
If the problem hasn’t been resolved at this point, there could be an issue with the DNS settings. For example, using an outdated IP address might cause an HTTP 304 status code.
Therefore, another approach to try is flushing the DNS and resetting the TCP/IP.
With Chrome, you can flush the browser DNS by entering “chrome://net-internals/#dns” into a new tab.
Hit Enter, and then click on the Clear host cache button:
You can also flush the DNS and reset the TCP/IP in your OS. If you need detailed guidance, you can refer to our tutorial on How to Flush DNS Cache (Windows, Mac, Chrome).
5. Try Using the Google Public DNS
Another potential cause is an incorrect DNS address. Therefore, it’s worth using the Google Public DNS to see if that resolves the problem.
Tired of WordPress issues and a slow host? We provide world-class support from WordPress experts available 24/7 and blazing fast servers. Check out our plans
On Windows, you can do this by pressing the Win + R keys. In the Run window that appears, type “ncpa.cpl” into the command box, and then hit Ok.
In the Network Connections window that opens next, locate the network connection you’re using and right-click on it. Next, select Properties:
From there, double-click on Internet Protocol Version 4:
Select the option to “Use the following DNS server addresses”, then enter the value “18.104.22.168” under Preferred and “22.214.171.124” under Alternate:
When you’re done, click on Ok. Then restart your system, and try accessing the website again.
To change your DNS server settings using macOS, you would go to Apple > System Preferences > Network:
In the window that opens, select your connection, then click on Advanced followed by the DNS tab:
Click the + icon next to the IPv4 or IPv6 addresses, to replace the existing addresses with the Google Public IPs.
For further instructions or for guidance on using Google Public DNS on a Linux or another OS, check out Google’s own DNS guide.
6. Check Your Server Configuration Files for Incorrect Redirect Instructions
An HTTP 304 Not Modified status code can occur due to both server- and client-related problems. If none of the methods we’ve covered so far have corrected the issue, your server configuration files may be at fault. For example, it’s possible that there are incorrect redirect instructions present.
The process for checking your server configuration files depends on whether you’re using Nginx or Apache.
At Kinsta, we use the Nginx web server. So if you’re a Kinsta user, you won’t have access to the .htaccess file that Apache users do.
However, you can still perform similar functions. For example, after logging in to MyKinsta, you can check the Analytics > Response section of the dashboard for a breakdown of response codes and redirects:
You can also check the error logs. If you have a specific question or request about editing the configuration files, your best bet is to reach out to our support team.
If your server is running on Apache, then you’ll want to look for the .htaccess file in the root directory of your site. You can do this by logging into the File Manager for your hosting account, and navigating to the public_html folder.
Once you open that file, look for a mod_cache module section. It should look something like this:
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>
We don’t recommend deleting anything, as that can cause severe damage. Instead, you can try temporarily commenting out the cache section by adding a “#” symbol at the beginning of each line.
After you save your changes, check to see if this resolved the HTTP 304 status code.
300s redirection codes are used to improve page speed and performance. Unfortunately, when a server or browser isn’t properly configured, communication between the two can get interrupted and result in an HTTP 304 not modified status code. There are six methods you can use to fix it, specifically:
- Clearing your browser’s cache data.
- Running a malware scan.
- Disabling your browser extensions.
- Flushing the DNS and resetting the TCI/IP.
- Trying the Google Public DNS.
- Checking your server configuration files for incorrect redirect instructions.
If you enjoyed this tutorial, then you’ll love our support. All Kinsta’s hosting plans include 24/7 support from our veteran WordPress developers and engineers. Chat with the same team that backs our Fortune 500 clients. Check out our plans