You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(context: discussion with @atinux on discord and initial draft of #2519 for the idea of having a way to know if a request event is within the cache and transform it to the client state)
Currently, there is no straight-forward way to know if an event object is within a cachedEventHandler context. It can be determined by checking filtered headers for example like User-Agent header.
One simple way (as initially proposed in #2519) is to add a new event.context.isCached flag to determine this but this looses some context:
Are we responding first time to a cache or refreshing the cache
Is the cache skipped
What headers would be finally allowed to the client (some utils might need to make sure they work as expected)
Because of this, i am thinking to introduce a new event.context.cache: {} namespace to preserve the state:
Keys:
(if context.cache key exists, it is synonym of context.isCached)
cache.options: Cache options (should not be modified)
In next steps, we can provide additional info but requires some refactors on implementation:
cache.isBypassed
cache.key: Generated internal cache key
[...]
The text was updated successfully, but these errors were encountered:
(context: discussion with @atinux on discord and initial draft of #2519 for the idea of having a way to know if a request event is within the cache and transform it to the client state)
Currently, there is no straight-forward way to know if an
event
object is within a cachedEventHandler context. It can be determined by checking filtered headers for example likeUser-Agent
header.One simple way (as initially proposed in #2519) is to add a new
event.context.isCached
flag to determine this but this looses some context:Because of this, i am thinking to introduce a new
event.context.cache: {}
namespace to preserve the state:Keys:
context.cache
key exists, it is synonym ofcontext.isCached
)cache.options
: Cache options (should not be modified)In next steps, we can provide additional info but requires some refactors on implementation:
cache.isBypassed
cache.key
: Generated internal cache keyThe text was updated successfully, but these errors were encountered: