<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\App\PageCache\Identifier">
        <arguments>
            <argument name="request" xsi:type="object">DJOGlobal\Performance\Rewrite\Magento\Framework\App\Request\PageCacheIdentifierRequestHttp</argument>
        </arguments>
    </type>

    <preference for="Magento\PageCache\Model\Layout\LayoutPlugin" type="DJOGlobal\Performance\Rewrite\Magento\PageCache\Model\Layout\LayoutPlugin"/>

    <preference for="Magento\CatalogInventory\Model\Spi\StockStateProviderInterface" type="DJOGlobal\Performance\Rewrite\Magento\CatalogInventory\Model\StockStateProvider"/>
    <type name="Magento\CatalogInventory\Model\Spi\StockStateProviderInterface">
        <arguments>
            <argument name="qtyCheckApplicable" xsi:type="boolean">true</argument>
        </arguments>
    </type>

    <!--<preference for="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" type="DJOGlobal\Performance\Rewrite\Magento\Swatches\Block\Product\Renderer\Listing\Configurable"/>-->

    <preference for="Magento\Theme\Controller\Result\JsFooterPlugin" type="DJOGlobal\Performance\Rewrite\Magento\Theme\Controller\Result\JsFooterPlugin"/>

    <preference for="Magento\Store\App\Action\Plugin\Context" type="DJOGlobal\Performance\Rewrite\Magento\Store\App\Action\Plugin\Context"/>
    <type name="Magento\Framework\App\FrontController">
        <plugin name="storeCookieValidate" disabled="true"/>
    </type>

    <type name="Magento\Customer\Model\ResourceModel\GroupExcludedWebsiteRepository">
        <plugin name="DJOGlobal_Performance::GroupExcludedWebsiteRepositoryCache" type="DJOGlobal\Performance\Plugin\Magento\GroupExcludedWebsiteRepositoryCache"/>
    </type>

    <type name="Magento\Framework\App\Response\Http">
        <plugin name="DJOGlobal_Performance::AddLazyLoading" type="DJOGlobal\Performance\Plugin\Magento\AddLazyLoading" sortOrder="999"/>
    </type>

    <!-- Performance Testing -->
    <type name="Magento\GoogleTagManager\Helper\Data">
        <plugin name="DJOGlobal_Performance::PerformanceTestingDisableGoogleTagManager" type="DJOGlobal\Performance\Plugin\PerformanceTesting\DisableGoogleTagManager" sortOrder="99"/>
    </type>
    <type name="Tealium\Tags\Helper\Data">
        <plugin name="DJOGlobal_Performance::PerformanceTestingDisableTealiumTags" type="DJOGlobal\Performance\Plugin\PerformanceTesting\DisableTealiumTags" sortOrder="99"/>
    </type>
    <type name="DJOGlobal\ExtTealiumTags\Helper\Data">
        <plugin name="DJOGlobal_Performance::PerformanceTestingDisableExtTealiumTags" type="DJOGlobal\Performance\Plugin\PerformanceTesting\DisableExtTealiumTags" sortOrder="99"/>
    </type>
</config>
