Caching
Introduction
CareHubs caches data to make sure that your site loads quickly and provides a wonderful experience for users. More technical details can be found in Wikipedia.
How It Works
The idea behind caching is simple -- store data and processed information so that we can simply output it rather than re-build fresh each time a user loads a page.
When Is The Cache Cleared
For individual data elements within the application (think user meta, post meta, site options, etc), we clear them before they expire whenever new data exists. The idea is that users don't even know that caching is in place; the experience is seamless for them.
For full element cache items (entire pages, categories, hubcaps, images, etc), they receive an expires header, which dictates when a fresh version of the page or item will be retrieved.
Cache Expiration
Caching rules typically apply at two layers: 1) the application layer and 2) the CDN layer.
# | Item | Expires after |
1 | WordPress Pages | 24 hours |
2 | WordPress Categories | 24 hours |
3 | Hubcaps | Variable (1 to 24 hours) |
4 | Images | 1 month |
5 | Documents | 1 month |
6 | Javascript and CSS | 7 days |
7 | Header and footer | 25 days |
8 | Site navigation | 30 days |
9 | Site sidebar | 30 minutes |
Numbers 1 through 6 will not clear from the CDN when cleared at the application layer. They will remain until they expire in the CDN. For full content items, like Pages, Categories, and Hubcaps, the entire page (header, navigation, footer) is cached as a single file, so updates to these individual elements won't be reflected until the full page cache expires.
Also, it is important to keep in mind that the only items that cache on every site are Javascript, CSS, Images, and Documents. Everything else is toggle-able on a per site basis.