[MGNLRESTCL-45] Cache a REST response Created: 14/Feb/19  Updated: 09/Apr/20  Resolved: 23/Oct/19

Status: Closed
Project: REST Client
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Quach Hao Thien
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 19d 5h
Original Estimate: Not Specified

Issue Links:
causality
is causing MGNLRESTCL-154 DOC: Caching a REST response Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: Declarative REST clients
Sprint: Declarative REST 6, Declarative REST 7, Declarative REST 8, Declarative REST 9
Story Points: 8

 Description   

As a developer, I can configure a caching strategy on a REST connection, so that my integration is performant and cost-effective.

A developer does not want to make too many requests to a remote system, for example if I am hitting a CRM to get information about the current visitor - I dont want to make the REST request everytime the visitor visits a new page.

Also API's can be pay-per-request, or can throttle requests, so making fewer requests can also save money.

Acceptance Criteria:

  • Ability to setup a timed cache, and ability to set how often it is cleared.
  • Ability to programmatically clear all of the REST connection caches - may or may not handle individual REST caches per client.
  • Ability to clear the cache via REST, via a command.
  • Caching can be easily configured - probably directly on the REST connection configuration.
  • Requests with same URI but different headers do not overlap (e.g. language headers)

Scenarios:

https://wiki.magnolia-cms.com/display/TEASYINT/EasyRest+Cache+Thinking



 Comments   
Comment by Quach Hao Thien [ 08/Oct/19 ]

czimmermann jsimak

  • Ability to setup a timed cache, and ability to set how often it is cleared.

Basically, the cache will base on the time-to-live value to automatically remove the expired cache entry, but for timeout fallback case, we have to ignore the time-to-live and use an expire time (in seconds) as a property of cache entry, that mean the cache entries will never be removed automatically, until restart server or invoke cache.clear() manually. To overcome this drawback we can have a time-to-live alongs with expire time, but it may confuse the user.

 

cacheConfiguration:
  expireIn: 60
  timeToLive: 86400

 

or we can implicitly declare it in the back-end and apply for all cache entries of REST client.

What do you think?

 

Generated at Mon Feb 12 10:42:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.