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.

Performance best practices

Featured Replies

I wrote this article about writing a high performance lazy load module. It goes over a lot of techniques that can be used in other areas to improve the performance of your JavaScript, especially DOM interraction & scroll events.

http://rbrtsmith.com/2015/02/building-a-high-performance-lazy-load-module/

 

I will write another post soon about improving parallax performance.

Edited by rbrtsmith

OK saw the other thread so kind of covering css. I've been experimenting with this, the trial of four are...

 

  1. A website with a single css file linked in the head
  2. A website with the content of the single css file but instead done inline in the head.
  3. A website with a small linked css file in the head (for wrap, nav, basic cols etc) and the rest loaded via js in the foot.
  4. A website with the content of the small css file inline in the head and the rest loaded via js in the foot.

In all four cases the css has been minimised, extra line breaks removed, consolidation etc. The interesting bit is using pagespeed test.

 

  1. Flags blocking resources on the css.
  2. Passes fine.
  3. Flags blocking resources on css.
  4. Passes fine.

Which makes in-lining css in the head king, but semantically poor and heading for a larger core file. Then again this is just one test provided by Google, like the W3C validator with a pinch of salt with experimental things.

Here's a few:

 

1. Only call in Javascript on pages you're using it on, for instance if you're only using a lightbox JS plugin on single entry pages then only load the JS/CSS in those templates. You can save several http requests this way.

 

2. Keep your key CSS lean and mean, and use a single file for 1 http request.

 

3. Use a page weight budget, especially if your primary audience are mobile customers. I'm currently building an ecommerce site and we're working to a average of 500kb per page.

 

4. Avoid using 3rd party widgets (eg Facebook/Twitter) where you can, these typically pull in a ton of http requests and kb's. For Twitter I normally use a CMS addon that pulls in tweets directly and caches them, this avoids calling in 3rd party JS/CSS and gives me total control over styling and presentation.

4. Avoid using 3rd party widgets (eg Facebook/Twitter) where you can, these typically pull in a ton of http requests and kb's. For Twitter I normally use a CMS addon that pulls in tweets directly and caches them, this avoids calling in 3rd party JS/CSS and gives me total control over styling and presentation.

 

The same goes for fonts, use local and cache them for months, loads of time saved and no more 3rd party requests.

Using HTML5 localStorage can be good for caching things, also. I've onlu scratched the surface to make a site remember what layout you choose but it looks like it could be very useful for storing other information, almost like a replacement for cookies.

Keep in mind that as http2 gets more support, wording about http requests will be a thing of the past. Only have to worry about old IE as usual.

Using HTML5 localStorage can be good for caching things, also. I've onlu scratched the surface to make a site remember what layout you choose but it looks like it could be very useful for storing other information, almost like a replacement for cookies.

 

On one project I manage we run nightly crons to pre-cache certain pages to arrays so server request to delivery are now maybe 80% faster vs before we did this. So instead of running a find X within X of geopos X we now simply ask find X load cache. This sort of stuff when you get creative can seriously increase performance before the html render.

  • Jo 90 locked this topic
Guest
This topic is now closed to further replies.

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.