singleton
singleton copied to clipboard
[BUG] [Ruby Client] Incorrect max. age on client-side cache
Describe the bug The Ruby client does not use Singleton service's max age on client-side cached data that originated from Singelton service.
To Reproduce Steps to reproduce the behavior:
- Run a sample Ruby application that uses the Singleton Ruby client library.
- Trigger an action that sends a request to the Singleton service to fetch data and load data in cache.
- Notice that the server-side max-age is not used.
Expected behavior
Case # | Mode | Max. age configured in service?(HTTP response’s Cache-control: max-age) | Max. age configured in client config file? | Which max-age to use? | Notes |
---|---|---|---|---|---|
1 | Online | Y | N | Service | This should be the basic online-mode behavior. |
2 | Online | Y | Y | Client | Client may optionally override service’s max-age in online mode. This use case is for flexibility* only. |
3 | Online | N | Y/N | N/A | Invalid use case because the VIP service must always set the Cache-Control max-age in the http response. If not set, then it is a bug in VIP service that must be fixed. If this happens, client-side must handle the error by not caching the data (as if the response header is Cache-control: no-cache). Reference: rfc7234-4.2.2 |
4 | Offline | - | Y | Client | The client-configured max age is required in offline mode.There is no request to service so always use the client-configured max age. |
5 | Offline | - | N | N/A | The client-configured max age is required in offline mode.The client library will throw an exception/error. In this scenario. |
Additional context Cache Expiration Logic