-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can a block be cached for period of time? #1591
Comments
Yes. A "ttl" attribute designed for setting cache lifetime for a block in seconds.
See sample in app/code/Magento/Doc/view/doc/layout/default.xml |
Thank you for your help, rganin. 👍 |
You can find an example in file vendor/magento/module-theme/view/frontend/layout/default.xml
|
@rganin I try this "ttl" but it didnt work. I want to uncached BLOCK on product page and I try to use this TTL by setting to minimum time but its doent work. i am using maqgento 2.1.8 |
hi @jarnail1004 , I try this "ttl" attribute with a "60" value to have 1 minute for the cache lifetime, but it didn't work, like you. Do you have some information about it ? |
@agoeurysky , this works only if you are using Varnish cache. |
Hi,
Is it possible to cache a block for period of time, for example, it expires every 15 minutes? I would like to display a block on sidebar for all pages and to avoid performance issue as the information inside the block doesn't change frequently.
Is there an xml parameter available to do that?
Thanks,
The text was updated successfully, but these errors were encountered: