magespecialist/m2-MSP_APIEnhancer

Multistore Issue. One response for all stores.

Opened this issue · 1 comments

Preconditions

  1. Magento 2.2.3
  2. mysql Ver 15.1 Distrib 10.0.31-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
  3. PHP 7.0.22

Steps to Reproduce

  1. Install this module (obviously)
  2. Multistore.

Expected Result

  1. Cached response for each store separetely

Actual Result

  1. I've got one result for each store.

One comment about this situation.

I've fixed that issue by adding new key into

<type name="MSP\APIEnhancer\Api\CacheManagementInterface">
        <arguments>
            <!--
            This set of keys is for non-Varnish keys configuration
            It should be based on request information only
            -->
            <argument name="keys" xsi:type="array">
                <item name="store" xsi:type="object">MyCompany\WebApi\Model\CacheKeyProcessor\Store</item>
            </argument>
        </arguments>
    </type>

MyCompany\WebApi\Model\CacheKeyProcessor\Store returns new key with store Id.

Isn't the store code part of the URI

[rest/default/V1/products/:sku]

and with that a different key is generated?

I can't reproduce this issue...