How do I stop October CMS from using the cache?

621 Views Asked by At

I would like to have AWS CloudFront's cache policy handle the caching of an October CMS website instead of October CMS.

Is there a setting in config/cache.php or somewhere for the CMS to bypass the cache?

Thank you.

1

There are 1 best solutions below

0
On

Depends on which cache you're talking about. If you're talking about route caching, you're looking for cms.urlCacheTtl (https://github.com/octobercms/october/blob/develop/config/cms.php#L172). If you're talking about the parsed page cache you're looking for cms.parsedPageCacheTtl (https://github.com/octobercms/october/blob/develop/config/cms.php#L185). If you're talking about the generated asset cache you just have to set cms.enableAssetCache to false (https://github.com/octobercms/october/blob/develop/config/cms.php#L185).

October doesn't have a cache of fully rendered responses built in by default, so if you have any plugins enabled that implement that just disable them.

Additionally, if you truly wanted to remove every single cache that could be used throughout the entire system you can set the default cache driver to array, but be warned that this is only meant for local development and will cause issues in production (most visibly the Image Resizing functionality built into the core will stop working for resizing new images).