Questions tagged [block-cache]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
28 views

Magento 2 clear particular block cache

I have a block that displays a product grid with SKUs mention in admin system configuration and I have provided cache lifetime for that block as 3600 sec. It works perfectly fine. Now when admin ...
1
vote
1answer
32 views

Magento 2 - How to conditionally show/hide the minicart block based on the customer permissions

The problem: I'm running into an issue with the page/block caching and the minicart. In the template cart/minicart.phtml we have a permission check to see if the current customer is allowed to add ...
1
vote
2answers
89 views

Magento 2: The style.css inside Magento installation directory is effecting cache

I am very new to Magento. Recently I have to add extra styles to my magento website. So I go to adminpanel -> content-> design->configuration->my theme ->HTML Head I add the following ...
3
votes
0answers
26 views

Cache life time with varnish

Magento Magento\Framework\View\Element\AbstractBlock has method getCacheFiletime, it return lifetime of cache in seconds. How it will work with varnish?
0
votes
1answer
283 views

Magento 2: Set Cache life time to block

I am creating an extension for displaying labels in product page and listing page. Everything works fine except the cache issue. If I set the status to inactive, then the labels will display in the ...
1
vote
0answers
21 views

Magento 1.14.4.1: Not able to clean specific type of cache while using redis cache

I have redis which is hosted separably. I need to clean specific type of cache (i.e. block_html) using a script. The problem is that whenever I update product it doesn't reflect on the front-end side ...
1
vote
4answers
258 views

How to make page non-cacheable in cms

I have added below code to load custom template file from cms. <p>{{block class="Vendor\Module\Block\Testblock" template="Vendor_Module::test_template.phtml"}}</p> If template is loaded ...
2
votes
0answers
32 views

Magento 1.14.4.0: Programmatically clear cache of individual product

I need to clear the cache for individual product. For example, If admin change any detail/price/qty of product. I need to run script that clear the cache for that particular product only. I am running ...
0
votes
0answers
34 views

Why cacheable=“false” is not recommended on marketplace?

I have developed a custom module, If my cache enables dynamic data pages are not on updating every request so I have added cacheable="false" now everything is working perfectly. XML file : view/...
0
votes
0answers
66 views

catalog.topnav doesn't appear to be in static block cache

I have noticed by navigation doesn't seem to be being cached in static block cache and can see in profiler on each request showing like the below: Magento_Theme/templates/html/topmenu.phtml 0.398847....
1
vote
1answer
33 views

Cookie based conditional issues

I want to show a popup phtml based on wether a cookie has been set or not in my block class. The logic is roughly: class Popup extends \Magento\Framework\View\Element\Template { public function ...
1
vote
1answer
46 views

Does FPC respect block lifetime?

Example: FPC lifetime is 1 day but a page contains a block with a lifetime of 1 hour. How will that be handled? Will the page be served from the cache after the hour?
0
votes
2answers
176 views

Magento 2 Remove Page Cache in Home Page

I don't want cache to happen with home page but need them for all other pages. I am new to Magento and on going through I found that cacheable="false" in block will ignore cache in that page. How ...
0
votes
0answers
48 views

How Do You Invalidate Customer Data In Magento 2?

We have tier prices set up per customer group for products in a Magento 2 store. When changing customer group for a customer they have to log out and back in again for the correct prices to display. ...
1
vote
3answers
305 views

Magento 2 Header Sign In Sign Out Issue on Home Page

I'm facing an issue on Magento 2.2 . The details are as under 1.Go to home page 2.Click 'Sign In' from header 3.Enter login credentials to enter customer account 4.Click website logo to go back ...
3
votes
2answers
647 views

How to cache a block in block_html cache type in Magento 2?

I have a block file that does heavy data processing due to which my product page PHP rendering time increases above 2 seconds. I have disabled page_cache in my Magento 2 system so i cannot use ...
2
votes
1answer
232 views

How Magento manages store-wise cache

I am currently working on an architecture where I'd like to maintain separate caches (block cache, collection cache, FPC) for each zipcode. I am making the user select a zipcode at the beginning of ...
2
votes
0answers
37 views

Magento 1.9.3.6 - Disable cache for a specific module [duplicate]

could someone explain to me how to disable the cache of a specific module? I have this code in cms static block: {{block type="filterproducts/featured_home_list" name="featured_list" product_count="...
2
votes
3answers
1k views

How to disable cache for particular block in magento2?

I have created a block in header <referenceContainer name="columns.top"> <block class="XXX\ABC\Block\Category\News" name="news" template="XXX_ABC::catalog/product/...
0
votes
0answers
49 views

Customer name shouldn't display after rebooting the system

Steps to reproduce. login as a user close the tab without logged out restart the system open browser and open magento local see the welcome message ACTUAL RESULTS - Welcome!User name! - Sign in - ...
0
votes
1answer
301 views

How to display the current time in .phtml with caching enabled?

I created a really simple block in my child theme: /Magento_Theme/layout/default.xml: <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="...
0
votes
0answers
172 views

Disable cache for block Mage_Catalog_Block_Product_Price

I want to disable cache for block Mage_Catalog_Block_Product_Price. I know that if it was a different block I can disable it with this: <action method="setCacheLifetime"> <s>null&...
2
votes
0answers
360 views

Disable cache of static block Magento 1.9

How can I disable a widget or static block from being cached inside the Blocks HTML output cache? The widget loads a specific static block on all CMS pages. Inside the static block, I load a template ...
0
votes
1answer
807 views

Magento 1.9 Cache Custom Block Data

I have a custom module that displays products from a given category in a carousel. Now, I was wanting to cache the results, so the database is not queried and duly for speed optimisation. However, I ...
0
votes
1answer
745 views

How to turn off cache for a block?

i want to completely remove from cache the header-minicart. It is confused when magento cache and fpc work together. how can i do that?
4
votes
1answer
751 views

Hole punching full page cache on magento 2

I'm working in Magento 2 industry as a developer. I'm in a situation that i need to make a hole punching for a specific block. The block contains the reviews got from Trustpilot. I use curl to call ...
1
vote
0answers
71 views

Browser History back() Method decreases minicart quantity

We have discovered an interesting phenomenon with browsers history. When I add some products from several product pages to the basket then the minicart at top will always update and shows me the ...
0
votes
2answers
219 views

How flush specific type of cache

I need to flush only block HTML of Magento 1,9 If I write try { Mage::app()->getCacheInstance()->cleanType('block_html'); } catch (Exception $e) { die("[ERROR:" . $e->...
0
votes
1answer
395 views

How to clear cache on page loading magento 2?

I need to flush cache when a controller is loaded. This is mandatory for me because some function works only when cache is cleared. I Hope will get help.
0
votes
0answers
62 views

my custom block (in admin panel) cache

i create block in magento admin panel and i Calling template in it,the code is this (dynamic data) {{block type="core/template" template="catalog/category/sub.phtml"}} My problem is here, my block ...
6
votes
5answers
1k views

Magento 2 EE : Need to remove one single block from cache

I just need to remove single block phtml from FPC cache. How can I do that without using cacheable = "false". Because cacheable = "false" has an effect on the whole page. I am using a .phtml file in ...
0
votes
2answers
106 views

Grouped products doesn't display on category page only at first time

I am facing this unusual issue where grouped products are not being displayed only when the page loads for the first time. After refreshing the category page all products are being displayed. I have ...
-1
votes
1answer
371 views

How to get current product from esi request?

I need to specify a ttl for a custom product block to force varnish cache invalidation on it without loosing FPC. Is there a way to get product (at least the productId) from the ESI request so that I ...
2
votes
1answer
1k views

Magento 2: Force block to be cached

I've a mega menu extension which I feel is quite slow. It seems to add about 2 seconds on load time for each page. As this menu does not change between pages I was wondering how to cache a block? I ...
1
vote
0answers
54 views

turning off caching on specific blocks

I'm working with emarsys and i keep having issues with their webextend scripts. Data is being served to wrong customers and abandoned emails are populating the wrong items. They keep telling me it's ...
2
votes
1answer
2k views

Why do I have to refresh Blocks HTML output / Page blocks HTML every other hour? [duplicate]

Whenever I login to magento backend it shows invalidated Block HTML Cache. This is happening even without making a change to the website or database. Why is that and how to fix it? I am using Magento ...
3
votes
2answers
6k views

Magento 2: get customer id of logged in user with cache enabled

I need to get the customer id of the user that is logged in. Using the following code it works fine for blocks where cache is disabled. But when there's a cached block on the page, it's null. Even if ...
1
vote
0answers
708 views

Magento 2. Flush cache programmatically for particular block

I'm creating catalog rule programmatically and I want to see update price block on category and product pages immediately after that. Is there way to flush cache for price block only? Or what is the ...
1
vote
3answers
914 views

Where can I see a different between cacheable=“true” and “false” in layout?

I know this is seem stupid question but I'm a newbie in Magento 2. So I want to ask you guys that Where can I see a different between cacheable ='false' and cacheable='true'?. I checked in Local ...
0
votes
1answer
1k views

Lifetime disable of html cache block [duplicate]

I'm on Magento 1.9.2.2 and getting the static block bug. As a work around I disable the blocks html cache, the problem goes away. But every day something goes in and the block html cache gets ...
0
votes
1answer
1k views

Public\private content

Refering to this piece of docs: http://devdocs.magento.com/guides/v2.1/config-guide/cache/cache-priv-priv.html, is it possible to put some private content into page which is public and it will not ...
1
vote
2answers
149 views

Block cache and flat tables (Mage_Catalog_Block_Product_List)

We are using Magento Enterprise and use flat tables and automatic re-index. I have a block that extends Mage_Catalog_Block_Product_List. Block cache is enabled and block cache is tagged with all the ...
3
votes
1answer
47 views

What is the benefit of explicitly specify `short_cache_id` in Magento Block

I can see below code in the class Mage_Catalog_Block_Navigation atapp/code/core/Mage/Catalog/Block/Navigation.php public function getCacheKeyInfo() { $shortCacheId = array( '...
2
votes
1answer
2k views

Set block cache lifetime for block in layout xml

Magento 2.1.1. I have added custom sorting of products in catalog pages, by random order and I want my block to be dynamicall, so with every change of sorting for random the collection should be ...
2
votes
2answers
416 views

Static block doesn't get cached correctly between SSL and non-SSL

I'm having an issue where I insert an image into a static block using the WYSIWYG editor. This results in an image tag like this: <img src="{{media url="image.jpg"}}" /> The problem is that ...
1
vote
2answers
209 views

Disappearing top.links while refreshing the page second time if enabling the FPC

I had installed Lesti_FPC module in my website. Recently we had made lot of design changes with the website. Then those changes are migrated to live. After migrating, the top links are disappearing ...
3
votes
2answers
2k views

Magento 2: Cacheable false for specific block not working

I am trying to detect user’s country based on their IP address and ability to change country as well. However with the use of Full Page Cache, country name is not getting display properly. Sometimes ...
1
vote
1answer
1k views

FPC (lesti) won't holepunch certain area [closed]

Working on a webshop with lesti:fpc + redis and magento caching. Now i encounter the problem that (when lesti fpc is enabled) holepunching a certain module isn't working. The part view2.phtml (...
0
votes
1answer
1k views

Should I use dynamic variables in cache tags?

TL;DR Can/should cache tags in Magento be dynamic? Background I'm creating a CMS integration from an external CMS into Magento. The data is stored in Elasticsearch in AWS. I have a custom ...
0
votes
2answers
2k views

Magento2 Product List Widget Cache Problem - prices not reloading

I have a product list widget inserted in the content area of a magento 2 store frontpage. The widget is inserted using the following code: {{widget type="Magento\CatalogWidget\Block\Product\...