Отключите @Cacheable для определенного контроллера Hybris.JAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Отключите @Cacheable для определенного контроллера Hybris.

Сообщение Anonymous »


We have a scenario where we need to update userPriceGroup using an admin account. One product in our site can have multiple prices depending on user tier. The problem happens when we call this endpoint of ProductsController, /{baseSiteId}/products/{productCode}. It does not return the correct price immediately after changing the tier. We noticed there's a slight delay when returning the correct response. We then reviewed the controller again and noticed the @Cacheable annotation. Is there a way on our backend side to disable below code? Do we need to override this controller and in that child controller, remove the @Cacheable? Thanks in advance to anyone who can provide their knowledge in our predicament.

@CacheControl(directive = CacheControlDirective.PRIVATE, maxAge = 120) @Cacheable(value = "productCache", key = "T(de.hybris.platform.commercewebservicescommons.cache.CommerceCacheKeyGenerator).generateKey(true,true,#productCode,#fields)") Scenario: Admin changes tier from Bronze to Gold
  • Bronze price: 582
  • Gold price: 552
  • Expected after tier update: 552
  • Actual after tier update: 582


Источник: https://stackoverflow.com/questions/780 ... controller
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»