Cacheable and uncacheable pages

To create an uncacheable page, mark any block on that page as uncacheable in the layout using cacheable="false".

Example:

<?xml version="1.0"?>
<!-- /** * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <container name="root">
        <block class="Magento\Paypal\Block\Payflow\Link\Iframe" name="payflow.link.iframe" template="payflowlink/redirect.phtml" cacheable="false"/>
    </container>
</layout>

Note

During theme development, when you change any files stored here, you need to clear
pub/static (preserving the `.htaccess` file in place) and var/view_preprocessed directories,
and then reload the pages. Otherwise the old versions of files are displayed on the storefront.

Enable/ Disable Module

Show status of module: it will list all enable and disable module

bin/magento module:status

Enable a module:

bin/magento module:enable --clear-static-content Module_Name

here Module_Name is the name of the module you are enabling.
Now we can see that the module is recognised and approved (enabled) by the system. This means that ’Module_Name’ => 1 entry has been placed in the array within the app/etc/config.php file.
Then you get a notification to “register” the module on a database level as well.

bin/magento setup:upgrade

Disable a module:

bin/magento module:disable --clear-static-content Module_Name

Categories: Magento2

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *