Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hello Friends.

I have written a couple of blog posts on website speed recently. The first one on WEBP and how to set it up with WordPress. The second one on StackPathCDN and how to set it up with your site and how to get a grade A on PageSpeed and YSlow.

I am going to be writing a third roundup post within a few weeks and would love for you to leave me a sentence or two about what you do to get your site loading fast, your suggestions, gripes, ideas and recommendations. In return I will include a DoFollow link back to any post you want it pointing too 😁.

Let them roll.

Phillip

I did it like this:

  • Send less data.
  • Reduce the number of server calls.
  • Decent hosting.

It's not rocket science

For me I found a lot of gains in splitting my css / js into what's required for initial paint (inline) and what is fluff or used with interaction (external). Coupled with switching the body style using js it lets you build inline essentials for both JavaScript enabled / disabled. Probably easier to show the sort of thing;

<html lang="en-GB">
<head>
<title>Test</title>
<style media="all">
/* Essentials */
.nojs {background:#ccc;}
.js {background:#fff;}
a { color: pink; }
</style>
<noscript>
<link rel="stylesheet" href="external-styles.css">
</noscript>
</head>
<body class="nojs">
<script>(function() { document.getElementsByTagName('body')[0].className = 'js'; })();</script>
<ul>
<li><a href="#">Link</a></li>
</ul>
<script>
function loadjscssfile(filename, filetype){ 
	if(filetype=="js"){ var fileref=document.createElement('script'); fileref.setAttribute("type","text/javascript"); fileref.setAttribute("src", filename); }
	if(filetype=="css"){ var fileref=document.createElement('link'); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", filename); }
	if(typeof fileref!="undefined") { document.getElementsByTagName("head")[0].appendChild(fileref); }
}
loadjscssfile("external-styles.css", "css");
loadjscssfile("main-js.js", "js");
</script>
</body>
</html>
/* in external-styles.css */
a:hover { color: blue; }

 

Its not Wordpress, but on custom build I'm working on, for getting assets I've got all my 'critical' / 'above the fold' CSS in the head of my site, and then all the other CSS in an external file, all minified and tidied up with webpack obviously.

For Javascript I've got a vendor.js that contains any code used by external modules (NPM) which is heavily cached, then a core.js file which contains custom built side wide code used extensively, which also includes a custom built router and library loader written in Typescript which loads a page specific js file only when needed, it does result in having a fair few compiled Javascript files, but then the contact page for example doesn't have a load of code it doesn't need from a checkout page for example. I've also got FontAwesome loaded in by NPM but using a custom icon set so it only pulls in the dozen or so icons I actually use rather than the entire library, and then on the client side it converts them all to SVGs when loaded in the browser.

From an image point of view, my larger 'header' images, such as a blog header image, I've got them using a 'resizable' class, which then I've got a bit of Typescript that hooks onto them and loads the correctly sized image for the viewport using a predefined set of image widths, starting at the smallest size first, then on my image server the image will be resized and cached at run time by a PHP script, so there's only one large 'master' image on the server, but the PHP script will serve and cache the image returned at 300px width for example for mobile screens to save loading a 1200px image.

All of my assets are also stored on a CDN server on the network which again is heavily cached during deployment unless a files hash has changed at which point the cache for that single file is busted.

The site is still a WIP but is nearing completion and I have noticed a speed increase from the current version using more 'traditional' CSS/JS/Image management on both local development and on the external development server.

Ditch WordPress and go with something like Gatsby + Contenful that triggers static builds on content changes so your users don't make any server requests for the initial payload which would be served from a CDN.

You can optimise a wordpress or any traditional CMS site all you want but it's not going to be quicker than the above unless the developer is doing something horribly wrong.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.