Caching

Field Caching

Bloqs offers field caching, which will cache the final output of a single Bloqs field in a template. Enabling caching will decrease page load time by rendering cached content, thus avoiding the additional parsing necessary to render all the custom field data from the atoms inside each bloq. When an entry is saved, the corresponding cache item will be deleted. The next time the field is rendered on the front-end, a fresh cache item will be created.

$config['bloqs_cache_enabled'] = true;

When displaying a cached Bloqs field on the front-end, it will be wrapped in the following html comment tags:

<!-- Start cached Bloqs output -->... Your bloqs content here ...<!-- End cached Bloqs output -->

The only way to clear a cached item is to re-save an entry, or clear the cache manually. If a site is actively being developed, it is probably best to not enable caching because making changes to template files will not clear the cache, thus you may not see the most up-to-date content. Enable cache in production sites only.