Check out this article with some really good ideas and tips
http://www.smashingmagazine.com/2014/09/improving-smashing-magazine-performance-case-study
We are embarking a redevelopment of our front end codebase with focus on speed and performance. We already have a 'performing' website with static caches, etc - but there's more to be done.
Following a review of where we are at now, and some housekeeping, we will be doing the following tasks:
Media query consolidation
– Look at our current media queries
– List resolutions we are going to design for
Responsive behaviour review
- Anything that needs tweaking for a better mobile experience
- ‘Content Choreography’
- Flexbox
- Fat fingers
Review main navigation behaviour
Review search UI on mobile
- Suggest any changes
Styles refactoring
- We need to remove bloat
- Rewrite any classes/styles that are similar
- Minimise
Conversion to LESS
- convert to an object orientated way of creating/managing styles
Review of our javascript
- Review of all javascript libraries and custom functions
- Remove everything that is obsolete and not required
Upgrade of JQuery
- We still use Jquery 1.7.2 from 2012!
- Upgrade to latest version which provides the most browser support
- Update code that uses deprecated functions
Upgrade of all other javascript libraries
- Look at upgrading other JS libraries we have in use
Prioritise page contents. ie. everything that makes up an AQA web page
- Categorise them as either ‘core’, ‘enhancement’ and ‘everything else’
- Eg. BBC and Guardian modular page contents loading
Javascript refactoring
- Check that ‘core’ and ‘enhanced’ JS is optimised
- Rewrite any functions that are similar or not optimised
- Minimise and use native JS
JS blocking review
- Ensure we don’t have any blocking JS
- Rewrite any JS that is blocking
JS Loading
- Implement better way of loading javascript in a page
- Implement a non-blocking and asynchronous way of loading JS
- On-demand JS loading for everything not ‘core’
Implement critical css
- Minimal core styles that are consistent throughout the whole site and required for all pages to display properly
- Implement as embedded
Implement critical js
- Similar to critical css, but separate JS that is core to the display of AQA web pages – if any
- Implement as embedded
Prevent FOUT (flash of unstyled text). ie. slow loading of web fonts
Web font caching
- Look at way to cache web fonts properly on people’s web browsers - localStorage!
Browser caching for static files
- I’m not sure browser caching is utilised effectively
- Why not cache static files that never change forever
Remove the cumbersome search ‘subject finder’ drop down widget
- This actually uses up a lot of Matrix resource when loading for the first time
- It’s not used and only causes confusion
- What is the benefit of this, really?
Start using ‘compressive images’ technique for displaying JPGs on our web pages
- We can lower the file size of images greatly with this technique
- Smaller web page footprint – especially homepage
- Look at our process for images
- JPEG save for web settings - grunt it!
Simply Matrix page build
- Look at where we can reduce the number of assets and complex assets required to build core pages
- Use _performance mode
Responsive images
- Image production workflow
- Progressive jpegs as well as compressive
- Screen sizes that we need to / or want to target
- Where should we use SVG or PNG or JPEG?
- How to auto load the best image for the device being used?
- AQA logo is a good candidate