CacheProviderin order to activate caching with Masonite. We do so simple by going to our
config/application.pyfile and adding the Service Provider
config/cache.pyfile. Masonite only comes with a simple
diskdriver which stores all of your cache on the file system.
bootstrap/cachedirectory but can be changed simply inside the
DRIVERSdictionary in the
config/cache.pyfile. For example to change from
storage/cache/templatesdirectory, this will look like:
.envfile and you are good to go!
Cachealias that is loaded into the container from the
CacheProviderService Provider. We can retrieve this from the container inside any method that is resolved by the container such as drivers, middleware and controllers. For example we can retrieve it from our controller method like so:
bootstrap/cache/key.txtfile which contains a simple
Noneso be sure to check.
Noneif a cache is expired. If there is no time limit on the cache, this will simply always return the cache value.