The Yahoo Developer Network has an excellent and comprehensive guide to reducing the time a website takes to load. Some of the recommendations that can easily be applied to your Matrix system are:
Combine all CSS into a single external CSS file
<link rel="stylesheet" ... />instead of:
@importdirectly after the opening tag. A fast loading style sheet has been related to a user's perception on the speed of your site.
- Use the CSS File asset, and set Use Static Cache File and Strip Whitespace to "On". The first option ensures Matrix doesn’t need to parse the contents of the CSS File as often as it otherwise would, and the second reduces the overall size of the CSS File.
- For background CSS images, avoid using url (./?a=123) because Matrix can't cache these images. Instead use:
url(http://example.com/__data/image.gif) or; url(mysource_files/image.gif) or; url(%asset_url:X%) (where X is the asset ID)
- For buttons and icons, use a single CSS sprite instead of several separate images.
Asset ListingsFor Asset Listings to load faster, and to minimise their impact on Matrix, select a single, parent Root Node rather than several child Root Nodes. Also:
- use the Direct Links Only checkbox when you don’t need to list more than one level of assets;
- avoid Asset Grouping, especially by Metadata.
SearchFor Search Results to load faster, and to minimise their impact on your Matrix System:
- Set Search as Public User to "Yes" (if searching across live, public content).
- Set No Roles Check to "Yes" (if you're not using Roles).
- Set No Group Access Check to "Yes" (if searching across live, public content).
- Consider using a third party search engine for the majority or all of your search requirements - more on this later.
CachingIn the Design, edit the Design File and set all Design Areas to have an attribute of cache=1. This allows Matrix to cache these Design Areas.
Don’t cache the "body" Design Area because it will cache all content for the current asset, and ignore each asset's caching rules, possibly affecting the functionality of Custom Forms and other dynamic assets.
The __data URL
Any asset that has a __data URL will load significantly faster than assets from other URLs because no status or permission checking is done. By default, all file assets should use __data unless Allow unrestricted access is set to "No", or the file isn’t live with Public Read permissions applied.