The lifetime (TTL, time to live) of cache for your media and static content is set in the
.magento.app.yaml configuration file using the
expires key. The
expires: -1 key-value pair sets the cache to never expire.
Before changing cache TTL on the Production environment, we highly recommend testing such changes on the Staging environment first. You need to submit a support ticket requesting the Infrastructure Team to update configuration on these environments.
Set cache TTL: steps
- Locate the
.magento.app.yamlconfiguration file on your local environment.
- Specify the TTL using the
expireskey in the
websection of the
.magento.app.yamlfile. The time is specified in seconds, or it can be set to
-1for the files cache to never expire. You can set
locations, or specifically under
Below is an example of these settings:
# The configuration of app when it is exposed to the web. web: locations: "/media": ... expires: -1 "/static": ... expires: -1
- Git push the file to the Integration environment. The changes come into effect after the Git push is completed successfully and the application is re-deployed.
To make changes on the Staging and Production environments, submit a support ticket requesting the Infrastructure Team to update settings for these environments. In the support ticket, indicate that the changes you need are specified in the .magento.app.yaml file that you currently have on your Integration environment.