Skip to content

Commit b2e58d5

Browse files
author
Bruce Mead
committed
- Reduce default cache constant that was removed in #9841 (removed as currency wasn't included in cache key, now is added via this plugin https://github.com/VortexCommerce/magento2/blob/23d76ed074d7d5e465cbed782a2831abe192de96/app/code/Magento/Catalog/Block/Category/Plugin/PriceBoxTags.php#L68)
- Increase default cache time to 1 day (86400) this is more that acceptable as the cache key includes the current date so will not load for a new day which could have a new price rule, special price etc...
1 parent 4ee3bb3 commit b2e58d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/Magento/Framework/Pricing/Render/PriceBox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class PriceBox extends Template implements PriceBoxRenderInterface, IdentityInterface
2222
{
2323
/** Default block lifetime */
24-
const DEFAULT_LIFETIME = 3600;
24+
const DEFAULT_LIFETIME = 86400;
2525

2626
/**
2727
* @var SaleableInterface
@@ -86,7 +86,7 @@ public function getCacheKey()
8686
*/
8787
protected function getCacheLifetime()
8888
{
89-
return parent::hasCacheLifetime() ? parent::getCacheLifetime() : null;
89+
return parent::hasCacheLifetime() ? parent::getCacheLifetime() : self::DEFAULT_LIFETIME;
9090
}
9191

9292
/**

0 commit comments

Comments
 (0)