blog posts

HTTP ERROR 304 Not Modified Tutorial (Video Guide)

HTTP ERROR 304 Not Modified Tutorial (Video Guide)

Status Code 304 Is Associated With An HTTP Not Modified Error And Indicates A Communication Problem Between The User’s Browser And The Web Server

HTTP ERROR 304, If you or your users encounter this status code on your site, this status can completely block access to your content. In this article, we will teach you how to fix this error.

Since this error can be on the server or client-side, it can take some time to discover the source of the problem. Fortunately, several safe techniques exist for troubleshooting HTTP 304 Not Modified errors.

This post will discuss HTTP status codes and explain HTTP 304 status codes. We will then guide you through six ways you (or your visitors) can use to fix this error.

Introduction to HTTP status codes

To understand the HTTP 304 error, we first understand the status codes. Every time you make a request to your browser – such as accessing a specific website – an HTTP status code is sent between your browser and the server to exchange information.

When you meet a status code, it usually means that something is wrong. There are over 40 different status codes that can involve. However, there are only a handful of status codes that you will probably encounter directly.

HTTP status codes fall into five categories, numbered between 100 and 500. Each series shows a type of problem. For example, error codes that fall into the 400 categories, such as the 404 Not Found error and the “401” error, usually mean a request problem and the website or page is inaccessible.

On the other hand, category 300 codes – like the HTTP 304 Not Modified status code that we will focus on in this post – redirect codes. They clarify that another source has temporarily or permanently replaced the requested information. When you encounter one of these status codes, more action needs to be taken.

What is HTTP 304 status code?

An HTTP 304 error, sometimes known as a 304 Not Modified error, is a code that tells your browser, “The requested source has not changed since you last accessed it.”

The IETF defines error 304 Not Modified as follows:

Status code 304 indicates that a GET or HEAD conditional request has been received, and if this is not the case due to incorrect conditions, it will result in a response of 200 (OK). In other words, there is no need to transfer a display from the target source to the server because the request indicates that the client who conditioned the proposal already has a good collection. So it directs the client-server to use that stored display, like when it has a 200 (OK) response.

IETF

Your server tells your browser (or visitor) that the resources stored (in cache or cache) in the browser have not been modified since the last time you visited that page. Your browser recovers a saved version of the webpage from the stock. The purpose of this is to improve the speed and delivery of the page by preventing the repeated downloading of similar information by your browser.

Understand HTTP 304 requests

When your browser stores a resource in the cache, it stores information called a “Last-Modified header.” This information was sent from the server. If a browser receives a request for a webpage that has a copy saved but does not know if it has the latest version, it will send a “conditional validation” request to the server.

The browser sends the “latest modification” date and time to the server via an “If-Modified-Since” or “If-None-Match” header to copy its source. The latter is a unique identifier used to specify the version of a particular resource. The server checks these headers and also looks at the ETag value.

If the values ​​of these files are the same as the subject of the error, the server sends the HTTP 304 Not Modified response header, and the browser uses the saved copy of the source. If the browser copy is old, the file has changed since the last request, sends an HTTP 200 code, and uses a new document.

Unfortunately, several issues may cause HTTP 304 to respond when they are not supposed to.

The most common causes are:

  • Server or Domain Name Server (DNS) Configuration Problems
  • A cache resource that is infected or corrupted (for example, malware or viruses that affect the browser)

Status code 304 can be due to a problem on the server or client-side, so troubleshooting may need to diagnose and fix it.

HTTP 304 Error Fixing Methods Not Modified

The methods you can use to resolve HTTP 304 status code vary from simple to relatively technical. Search engines are responsible for indexing and storing websites, so this problem is usually tracked in the browser used to access the site.

Error fixing method 304

Of course, there are many things you can do to fix the browser of people trying to access your site. However, understanding what might be causing this problem for visitors can be helpful, whether you are trying to find a solution or dealing directly with them.

1. Clear browser cache data

In the first method of fixing the HTTP 304 Not Modified error, we first delete our browser data. It includes deleting all browser data, cookies, and cache information. Clearing your browser data to clear the cache may help you access the URL.

Instructions for running this process vary depending on the browser you are using. If you still do not know how browsers do the caching process, see our Guide to Browser Caching.

2. Install malware

Unhealthy browsers infected with a virus or malware may cause this error. Therefore, it is good to run a scan on your system. Doing so can help identify and eliminate any issues that may be interrupting, interrupting, or interfering with your HTTP request, including problematic extensions.

You can run a malware scanner and a built-in cleaning tool if running Windows Chrome. To do this, first, make sure you are running the latest version of Chrome. You can find out about your Chrome version by opening a new tab, clicking on the menu icon, and then about Chrome.

Notice the Chrome version

If your browser has not been updated to its current version, you can fix it in the same place. Then, open a new Chrome tab and enter “chrome: // settings / cleanup” in the URL bar. Press Enter and then click the Find button next to Find and remove harmful software :

Scan for malware

The scanner starts and then reports the results.

Unfortunately, some other browsers, such as Firefox and Edge and the macOS and Linux operating systems, do not offer versions of this built-in tool. Instead, you should run a malware scan on your computer using antivirus software.

3. Disable browser extensions

Your browser extensions may also be infected and interfere with server requests and communication. For this reason, you may want to disable them as well. You can do this by opening the Chrome menu and going to Settings> Extensions:

Disable browser extensions

You can disable each one on the plugins page by clicking the corresponding button. And you can also remove unused or old plugins via the Remove button:

Remove Chrome extensions

The goal is to manually remove or disable any extensions and check if the HTTP 304 Not Modified error is resolved. Then, you can try to return them one by one. Again, this process will vary slightly depending on your browser.

4. Check DNS and reset TCP / IP

If the problem persists, there may be a problem with the DNS settings. For example, using an older IP address may generate an HTTP 304 status code. Therefore, another way to solve this problem is to check the DNS and reset TCP / IP.

With Chrome, you can clear the browser DNS by entering “chrome: // net-internals / # dns” in a new tab. Press Enter and then click the Clear host cache button:

Clear browser dns

You can also clear DNS and reset TCP / IP on your operating system.

5. Try using Google Public DNS

Another possible reason is that the DNS address is incorrect. Therefore, it is worth using Google Public DNS to see if it solves this problem. In Windows, you can do this by pressing Win + Rn the Run window that appears, typing “ncpa. cpl” in the command box, and then clicking Ok.

In the Network Connections window that opens in the next step, find the network connection you are using and right-click on it. Then select Properties:

Use Google's public DNS

From there, double-click Internet Protocol Version 4. Then select “Use the following DNS server addresses,” then enter “8.8.8.8” in the preferred field and “8.8.4.4” in the alternative field:

IPv4 portability

When you are done, click Ok. Then restart your system and reaccess the website to see if the HTTP 304 Not Modified error is displayed again.

To change DNS server settings using macOS, go to Apple> System Preferences> Network:

Change DNS settings on macos

In the window that opens, select your connection, then click Advanced, and then the DNS tab:

Click the + icon next to IPv4 or IPv6 URLs to replace existing URLs with public Google IPs.

6. Check the server configuration files for incorrect redirect instructions

HTTP 304 Not Modified error may occur due to server and client problems. For example, there may be incorrect redirection instructions. If none of the methods we’ve covered so far fix your issue, your server configuration files may be to blame.

Checking your server configuration files depends on whether you are using Nginx or Apache. Also, one of the sections that you should check. Log errors on your server that may be helpful.

If your server is running on Apache, you need a .htaccess file. Search in the root directory of your site. You can do this by logging in to your File Manager account manager and going to the public_html folder. Once you open that file, look for the mod_cache section of the module.

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 do not recommend deleting anything, as it may cause severe damage. Instead, you can temporarily change the cache by adding a “#” symbol at the beginning of each line. After saving your changes, check if this fixes an HTTP 304 Not Modified error.

Conclusion

Category 300 redirection codes are used to improve page speed and performance. Unfortunately, when the server or browser is not configured correctly, communication between the two may be lost, leading to an HTTP 304 Not Modified error.

 There are six methods you can use to fix it, in particular:

  1. Clear browser cache information
  2. Run malware scans
  3. Disable browser extensions
  4. Clear DNS and reset TCI / IP
  5. Try Google Public DNS
  6. Check server configuration files for incorrect redirect instructions