Caching to make the site faster
By Ed Mitchell 11th January 2011
We have noticed that the site struggles a bit just after we send the newsletter out – we think that this is because Apache (the webserver) suddenly has a lot of processes to run and runs out of memory when everyone clicks on all the links. You can see the spikes here. Oooh errr.
So we’ve ‘cached’ a variety of the popular page types. This means that copies of them are stored in an easily accessible place without making the deep operating systems of the site need to get out of bed too often.
Jim the developer and Chris the system administrator have been colluding and agreed to do some short term caching for now and look into installing a system called ‘Varnish hyper-speed’ (or something) in phase 4.
Jim has added caching to the popular items like this:
- 5 mins – News/events
- 30 mins – Blogs
- 1 hour – Initiative, project and people maps/lists/directories
- 3 hours – Patterns directory
This means that new or updated content appears immediately on that item’s page, but depending on the type (blog/news etc.) there will be up to a wait (as per above) to see new content on the index/directory/map pages. So if your new initiative profile doesn’t immediately appear on the map, that is why.
This will take a fair amount of load off the system without being that noticeable. In general these pages are much faster now, and lighter on the server. The difference between cached and uncached People map is the difference between <1sec and ~5sec.