Error 404 on CDN: why this is not an issue

Why a 404 error may appear when receiving a CDN address for your project and what does it mean?

7 days free

Imagine you've created a cdnnow! account and got your CDN address.

Let's dive into something that worries many of our clients: the 404 error when trying to open the CDN URL you were given to connect to. You've probably experienced this situation: opening your CDN project's URL and seeing a plain error message instead of the expected website page. Many start to worry thinking that the CDN URL isn't working for some reason. But in reality it's much simpler, and we'll explain this.

Why use CDN distributing static content?

First, let's recall why a website needs a CDN, especially when it comes to serving static content. A CDN (Content Delivery Network) is needed to ensure your files (images, styles, scripts, and so on) load faster by caching them on servers located closer to the user. This is especially important for projects with high loads and geographically dispersed audiences. Imagine that users are accessing a website from all over the world, and the server is located, say, in a Moscow data center. Every time a page loads, the browser needs to send a request to Moscow for each file included on the page, wait for a response, and only then display the website. This takes a long time. Now, imagine that some of your website's content has already been uploaded to multiple servers around the world. Then a user in New York can get the necessary files not from Moscow, but from the nearest data center in the US. Everything happens faster, smoother, and the website loads instantly. And for these purposes, a CDN is simply irreplaceable.

But not all of your website's information is static. For example, website pages, dynamic data, or personalized content are useless to cache, as they can change each time depending on the request. In these cases, the CDN doesn't store copies of the pages. This is why we see an error message instead of pages.

What is a 404 error and why does it occur?

This is a standard server response that indicates that the requested resource cannot be found. For the user, it looks like a message saying «Page not found,» which is oftenly alarming. And, of course, when you see such an error at your CDN address, the logical question arises: "Why? After all, the link should work, it's a copy of my website".

In fact, by default, we only configure caching for certain types of files, such as images, styles, scripts, fonts, and other static elements. But pages, as we said, are not cached. Therefore, when you try to open the link to the CDN itself, which, for example looks like https://user88662.nowcdn.co/, you get a 404 error. But this does not mean that the CDN is not working or that the link is broken. It is simply the result of the requested home page of your website not being cached in the CDN. The pages themselves are not on our servers, and the CDN simply cannot deliver them to the user. But static content is delivered without any problems.

Here's an example: https://user88662.nowcdn.co/_assets/images/logo/header_logo.svg — the image is successfully loaded from the CDN, confirming that everything is working as it should

However, sometimes an error occurs when linking to a static file, for example: https://user88662.nowcdn.co/_assets/images/logo/header_logo2.svg. If we know for sure that this type of file is configured for caching in your cdnnow! account configuration (in this case, images), and the link gives us an error message, it is worth checking whether this file ever exists on your domain. Perhaps the file has been deleted from the source server or there is a mistake in the name.

Which files are cached by default in cdnnow!

In the project settings in your personal account at selfcare.cdnnow.pro on the «Caching» tab you can find a list of file types and their extensions that are cached in the CDN by default:

  • Images (bmp, gif, ico, jpeg, jpg, png, svg, tif, tiff, webp)
  • CSS styles (css)
  • javascripts scripts (js)
  • Fonts (otf, ttf, woff, woff2)
  • Archive files (gz, rar, z, zip)
  • Audio (aac, flac, mp3, ogg, wav)
  • Video (avi, flv, mkv, mp4, mpeg, oga, ogv, ogx, vob, webm)
  • Embedded objects (swf)
  • API calls (REST, SOAP) (json, wsdl, xsd, xml)
  • Documents (csv, doc, docx, odp, ods, odt, pdf, pps, ppsm, ppsx, ppt, pptm, pptx, sldm, sldx, txt, xls, xlsx)
  • Executable files (com, exe, apk)

You can use checkboxes to select only the types you want to cache. Or you can enable full caching of everything on the site — we'll talk more about that later.

You can also read our article on how to cache other files types (other expensions) .

Here we're talking about a direct link to a page, not to some file (for example https://user88662.nowcdn.co/).

It is important to understand one point: a 404 response to a direct CDN address is not a failure or a system error. This is normal behavior, designed as a part of the default settings. Think of it this way: the page is not included in the list of cached files, so the CDN cannot serve it. At the same time, all other static files (from the list of included extensions) are loaded correctly.

When should you enable full caching?

You can enable the “cache everything on the site” option if the list of files specified for caching does not include the extension you need. You can also read an article on how to cache other files types (other expensions) . If this option is right for you, we recommend setting up a redirect from the direct CDN address to your domain. This can be done on the SEO tab in your personal account, in the project settings. Enter your domain address for redirecting direct requests. Then files via the CDN address will open via the CDN link, and pages will redirect to your domain.

Why soma pages are better not to be cached?

Some pages of the site are better not to cache, as they contain dynamic content that changes from user to user or depending on the state of the system. Here are some examples of such pages:

  • Search results. Search results change depending on the query, and caching them will cause users to see outdated data
  • Shopping cart. In online stores, the shopping cart usually contains items that are unique to each user, and caching may cause confusion.
  • Login pages and personal accounts. These pages contain confidential user data, and caching them could pose a security risk.
  • Dynamic banners or prices. These elements of the site change depending on the user, time, or other factors, and caching them can cause harm.

Therefore, it is important to choose correctly what should be cached and what should not. This will maintain website performance while avoiding errors and incorrect display of information. Since 99% of customers only need to distribute static files via CDN to speed up website loading, rather than the entire website, we have made the default settings without page caching

Let's summarize

A 404 error on a direct CDN address is a normal part of the system's operation, and there is no need to be concerned about it. It occurs because pages are not cached by default. If you need more, you can always configure your caching to suit your specific needs. The main thing to remember is that proper caching settings improve performance and usability, and our experts are always available to assist with implementation.

If you don't have a cdnnow! account yet, now is the time to create one. There is a free 7-day trial period.

Creating a CDN Account

If you don't yet have a cdnnow! account, submit a CDN activation request, by providing your email, website, and CMS.

You will receive an email with access to your Control Panel and a default CDN address for your project in the format userXXXXX.nowcdn.co or userXXXXX.clients-cdnnow.ru, where userXXXXX — is your unique identifier.

Check also:

We use cookies to improve your experience on the website.