spring-cache

    0熱度

    1回答

    我在Spring Boot應用程序中使用EHCache 2.9,並將緩存配置爲在300秒(5分鐘)後過期。 當我運行應用程序並首次請求元素時,它會被緩存,之後永不過期。 但是,當我做@CachePut它成功更新並更新元素然後返回。 我的配置有什麼問題? 這裏是我的ehcache.xml中文件: <?xml version="1.0" encoding="UTF-8"?> <ehcache>

    0熱度

    1回答

    我使用Spring Boot和EhCache開發日曆應用程序。 某些用戶可以請求某個特定周的音樂會,其他人可以請求整個月的音樂會。所有的響應都被緩存了300秒以減少響應時間。 緩存方法的輸入參數是startDate,endDate和username。 問題是,當用戶請求整個月的音樂會,然後在同一個月內的一個星期內,該方法將被執行兩次,即使「周」響應可以基於「月「迴應,因爲本週可能是緩存月份的一個子

    0熱度

    2回答

    嗨,我想知道是否有可能在Scala中利用Spring註釋緩存。我已經嘗試過,但正在接收下面的錯誤。我從一個依賴於scala包的java包運行應用程序。 No cache could be resolved for 'CacheableOperation[public scala.collection.immutable.List MerchantDataGateway.getAllMerchant

    0熱度

    1回答

    我想配置我的緩存大小。我正在使用@EnableCaching。這是我的緩存存儲庫。 VendorRepository public interface VendorRepository extends Repository<Vendor, Long> { @Cacheable("vendorByUsername") Vendor getVendorByUsername(String user

    0熱度

    1回答

    我試圖使用Spring @Cacheable註釋。 讓我們看一下: @Cacheable(value = "employee", key = "#surname") public Person findEmployeeBySurname(String firstName, String surname, int age) { return new Person(firstName,

    3熱度

    1回答

    考慮一個服務類,它可以插入和檢索對象並使用Spring緩存抽象,如何以返回可選方式註釋方法? class MyServiceImpl implements MyService { private static final String CACHE_NAME = "itemCache"; @Override @Cacheable(CACHE_NAME)

    8熱度

    2回答

    我工作的緩存實現(exstremescale)Maven的多模塊項目,在那裏我已經添加下面的Maven依賴於 @Override @Cacheable(value = "productDetails", key = "#productId + #orgId") public Product productRead(final String productId, final String pro

    1熱度

    1回答

    春季的JCache註釋@CacheResult允許像Spring自己的註釋那樣進行有條件的緩存嗎?例如 @Cacheable(cacheNames="book", condition="#name.length < 32", unless="#result.hardback") 我在文檔或源代碼中找不到任何東西。

    3熱度

    1回答

    我有兩種方法來獲取具有兩個不同參數的實體。我也有一個使用這些參數之一的保存方法。如何從兩個提取鍵下的緩存中驅逐實體?例如見下: @Cacheable public User getByUsername(String username); @Cacheable public User getByEmail(String email); @CacheEvict(key="#entity.

    5熱度

    1回答

    目前我正在使用Spring緩存和@Cacheable/@CacheEvict註釋。 我想獲得某種類似"INFO: i got those values from the cache, NOT from the host. awesome" 有一個清潔,簡單的方法來做到這一點控制檯日誌語句的?我們正在使用slf4j明顯btw,如果這是任何利益。