Website Speed Optimizations: Page Caching VS Module Caching VS Compression in CMS
One of the factors that make websites enjoyable to interact with is the speed of the site. Sites that have long load times tend to annoy visitors and lower search rankings. But how fast should a website be? Also, if the content is king, will visitors still stick around with longer load times if they have more interaction with a website?
Currently there are three options for websites to employ to decrease page load times and get the webpage to the visitor more quickly. These are page caching, module caching, and compression. Do these optimization techniques work together to make a better experience or will there be a trade off between speed and functionality.
Page caching take a whole snapshot of the page and makes it a static element. Think of this as taking a photo and when a visitor wants to see your webpage, you do not re assemble all of the elements just to show them, but you just show them the photo.
Module caching only takes a snapshot of the elements of the page. Think of it as a puzzle of pictures. Instead of having the website “redraw” each section, it just assembles the puzzle for the user.
What about functionality? With each of these optimization techniques there is a chance of losing some functionality on the site. It may be through corrupted pages, pages not updating, or loss in interactivity. In our next tech article, we explore the downsides to each of these optimizations.
Website Speed Optimizations in CMSs Part 2
Now that we know the basics behind each of the three main optimizations, there are certain negative effects that each one can produce. Some of them can only hamper parts of a page, while others can prevent a feature of a website from launching, while others if implemented incorrectly will actually slow down a website.
Module Caching Issues
Module caching is mostly harmless. This version of caching takes a snapshot of a section of your site ( the module itself ) and calls that snap shot state. The time that the "snapshot" is valid can be set in your back end parameters for each individual module in your Geoffresh site. If the module snapshot ever expired, it goes back and gets a new snapshot. But what if your users need to see an updated version of the module now and not wait for the module to update? This is where module caching fails as it will require the user to wait until the cache expires. A low time could be entered, but if the module needs to refresh instantly based on the user's state that is an issue.
As an example, let's say that the main menu of your geoffresh website has sections that only registered users can see. If the user arrives at your site and then logs in, they will not be able to see the updated menu items that only registered users can see. That is true until the module cache expires and the module refreshes and gives the user the snapshot of all of the items that they should be able to see.
Page Caching Issues
Caching and entire page can really speed up the speed of a website. Similar to module caching, it takes a snapshot not only of the modules of a website, but the entire page. This allows only 1 request for the page to be sent over and delivered to the user instead of the server reassembling the entire page every time.
The downside to this is when the page needs to change. For example, if you page has video animations on it, page caching may break that. Also, if a user requests the page from a mobile device and the cached page is for a desktop or tablet viewing device, the page will appear corrupt or incorrect on the device.
Compression can be very difficult but yields amazing results if used correctly. Compression will reduce all of the JS and CSS files into one large file and then compress that file to send to the visitor. Some resources can have issues with being compressed such as not allowing values to be passed. Also different CSS files can be called based on the what state the visitor is in ( logged in or out), what device they are viewing your website on, or even what browser they are using.
Different JS and CSS files can be excluded from compression to avoid this, however, excluding too many files defeats the purpose of compressing as more files will have to be sent over VS just the 2. Also, the compressor needs the user to request a page before it can compress everything. This would cause a longer wait time for the first visitor to a page. The subsequent visitors would experience the full speed after the first fulfilled request though.
In the next page, we will discuss what are the best use cases for each of these.
Website Speed Optimizations in CMSs Part 3
Now that we know what the advantages and disadvantages for each of the three main speed optimizations are, we are able to make the appropriate applications to sites. However, not all of the optimizations can be in place at the same time without breaking the site, losing functionality, or even slowing the site down.
This can be paired with page caching as well as compression. It does work well on it's own, but it can work together with with compression or page cache. This only applies if the site does not need it's modules refreshed.
This optimization works well with both Module caching and compression. Usually if module caching is enabled, then so can page caching. This option cannot be enabled if the state of the site will change based on the user viewing it or if there are moving images on the site.
Compression does not work well alone. By itself, will slow down a site as it will take time to compress all of the data. This optimization technique works best with Page Caching enabled. It can work with module caching to an extent as module caching will take snapshots of the page. Those snapshots can be compressed and transported over. This technique really shines when both module and page caching is enabled to compress the data and then send the smallest possible package over to the visitor.
If none of these can be applied, it is best to see about splitting the items on a page amongst other pages. Chances are, there will be too much going on for your visitors as well and giving them a more focused experience will help them move from page to page more efficiently.
What we can do for you
We understand how to use all three of these for your site. It all depends on what function your website will perform. Please contact us to speak to a representative and we will find what works best for your geoffresh website!