Home > Back-end >  Can design the caching framework?
Can design the caching framework?

Time:01-01

Now spring redis cache, @ Cacheable caches I query data from a database, for example a list, when I was a new record, @ CacheEvict will remove the cache, call Mr Khoja contains @ Cacheable method from the data again take new list, so efficiency is too low? Why only added a record delete the cache list? Can when new success, access to new records record, then retrieved from the cache list, the list. The add (record), and then put the list in the cache? I tried it on, normal operation of the business, just don't know will not be unpredictable problem, have no bosses to give directions?

CodePudding user response:

Your list is just a data in the cache, can't to update data locally, or you could direct the first item in the list is saved as an object,
  • Related