Questions tagged [block-cache]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Magento 2 what to use instead of cacheable=false

I just want to know what to use instead of "cacheable=false" as I have found more of the blogs for this not to use because of full page cache, so I just want to know what is proper method. I have ...
0
votes
0answers
11 views

extending Magento\Catalog\Block\Product\View but getProduct() is cached?

I have an api call to a 3rd party that I need to make on a product page. However the api call is particularly slow. I want to cache the results of the call on a product page. I have extended the ...
0
votes
1answer
20 views

Remove cacheable=“false” form Block in Layout file

In my multiple layout file has many block which have cacheable="false" attribute <block class="Block\Class" name="blockname" cacheable="false" /> if cacheable="false" is not add there have ...
0
votes
0answers
15 views

How to Disable Cache For A Custom Block in Product Page

I want to Disable a Cache for a Block in the Product page Before What I have tried so far is 1st Try cacheable="false" | it Gives an FPC issue affecting performance and Marketplace issue as well ...
2
votes
1answer
47 views

Disable cache for particular custom block called in layout xml

I want to disable cache only for particular block which is called in some pages like Home Page, Category Listing page , Product page and Shopping cart page etc. <block class="Namespace\Module\...
1
vote
4answers
92 views

Magento 2: What is difference between Cache Clean & Cache Refresh? [duplicate]

What is difference between cache refresh (when we select something and click refresh) and Cache clean?
0
votes
1answer
38 views

How to refresh the cache programatically in magento 1 EE

What is the code for clean or refresh the cache programmatically because I have got lots of snippets but all are not working in Magento 1 enterprise edition. Does anyone know how to solve it? Thanks ...
1
vote
2answers
135 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
132 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
1answer
98 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
30 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
2k 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
1answer
39 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
5answers
596 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
63 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
44 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/...
1
vote
1answer
41 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
59 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
333 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 ...
1
vote
3answers
600 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
2k 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 ...
3
votes
1answer
389 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
51 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
2k 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
50 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
451 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
197 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
426 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
1k 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
841 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?
5
votes
1answer
856 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
81 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
418 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
583 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
67 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
2k 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
111 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
496 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
2k 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
56 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
7k 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
733 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
1k 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
167 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
50 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
3k 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
453 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 ...