Extend caching config (TTL, Per-method policies, Multiple storage)

Would be awesome to have per project custom caching policies, with a config like this for example:
```
type CachingPolicy = {

/// Type of caching policy (maybe it could be possible to have something like “block” and “reorg” type?)
type: "duration",
/// The json rpc method to cache
method: string,
/// Some regex params for which to ignore caching if present in the params, or maybe something like in the upstream with an ignore + allow properties
ignoreForParams: string[],
/// Custom properties for duration based caching
duration?: {
period: string
}
}
```

My use case would be around the pimlico endpoint pimlico_getUserOperationGasPrice , like a 10sec caching, to have faster response and reduce pimlico credits consumption if we got a user activity spike on our end.

I think ti could also be useful for frontend applications to use a duration based caching for the eth_getBlockByNumber and params latest, with an ignore pattern like ^(?!latest$|earliest$).*$

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board

💡 eRPC

Date

Over 1 year ago

Author

Quentin Nivelais

Subscribe to post

Get notified by email when there are changes.