Get a faster web site

 

Slow web sites are irritating, decreases revenue and productivity. 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.
An alternative to cookies if you only need to store states is to use the web storage api. Make sure your code can handle that both cookies and web storage api is blocked by the user.

2. Remove any 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

Using third party CDNs to host your content, like javascript, images or video, will slow down your web site.
Make sure all content is hosted on your own site. Do not install software or plugins telling you how to improve performance or speed up your site.
They are usually always wrong, makes your web site slower and can additionally cause issues related to security, stability and uptime.
WebCDN can enforce a no-third-party / content-security policy on web sites.


Tracking / plugins

All advanced plugins designed to track the user will reduce the performance if your web site. Tracking is also blocked by default in most browsers.



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.