Get a faster web site

 

Slow web sites are irritating to everyone. Our web platform is therefore designed to be very, very fast.
With an optimal configuration in our cloud, your start site will be rendered by the browser after 1ms for http-pages and 4ms for https-pages.


PHP / dynamic content

1. Is the same content viewed by all / most users ?
Make sure you do not set any cookies as the WebCDN cache can't pre-cache your dynamic content. If you use cookies, you are nevertheless most likely in violation of GDPR without something which is equal annoying as slow pages: The infamous GDPR/cookie consent popup.

2. If set, remove pragma/cache-control- and expire-headers which disables caching.

If you run a WooCommerce store, talk to us and we can optimize caching for it.
If you run other types of portals with a login, make sure cookies are used after you login. You might also want to explicitly set cache-control headers for cachable-content after login/cookie is set.

3. Make sure your service works with the newest PHP-version.
WebCDN runs the newest PHP-version by default, but some customers have configured for older versions due to compability issues.
Running an up-to-date PHP-version will make sure the site runs as fast as possible.

Static content

You don't need to do much in order to get an optimal configuration. Static content is pre-cached and compressed by default.
For javascript files you may minify your files, but it doesn't increase performance much unless you have huge 5mbyte+ files.
Don't try to compress images too much. Most monitors today is 4k and your web site will look bad with low resolution images.


Third party content

Do NOT fetch content from third parties or CDNs, like javascript or images. This will always slow down your web site.
There is also security concerns and risk of additional downtime doing this.
We can enforce a no-third-party policy on your web site by activating WebCDN content-security-policy.

Database queries

The less queries a web page does, the faster a dynamic page will load.
If you are doing many db queries to render a single page you can save significant amount of loading time if you join as many queries as possible into a single query. Also make sure your page is using indexed queries.

Many CMS-systems are poorly designed for optimal database queries. WordPress is one of them, and you usually can't do much about this. It is therefore important that WebCDN can cache the page for you.

.htaccess

If you are still relying on this file, you need to stop it. Htaccess will slow down any system because it needs to be parsed for every single request.
If you need a catch-all fall back page, this is already configured with WebCDN. The root /index.php will always be executed as fallback, and you can use the environment variable REDIRECT_STATUS to check if the user hit a 404/non-existant page.

Relative URLs

Although not very important for fast page load, use relative URLs (/folder/picture.jpg) and not absolute URLs (https://example.com/folder/picture.jpg) when creating HTML content.
Using absolute URLs quickly becomes a total mess when dealing with multiple subdomains.