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
I have a question regarding fragment caching in the context of an API that uses versioncake.
It seems natural that request_version is taken into account when computing hash digests but since I could not find confirmation in the docs, I've pondered whether I should be using request_version for each cache key computation.
As I'm not too familiar with ActionView or Version Cake internals, many thanks in advance for confirmation (or refutation!) of my assumption. 🙂
––––––––––––––
To illustrate my post, here is an example reflecting what's happening in my development logs. It that particular case, everything looks fine: for each "api_version", different keys are set in Redis regardless of the level of nesting for partials that might exist in different versions.
Of course, feel free to take inspiration from it if you feel it could be a useful addition to the README. 🙂
Hello,
I have a question regarding fragment caching in the context of an API that uses versioncake.
It seems natural that
request_version
is taken into account when computing hash digests but since I could not find confirmation in the docs, I've pondered whether I should be usingrequest_version
for each cache key computation.As I'm not too familiar with ActionView or Version Cake internals, many thanks in advance for confirmation (or refutation!) of my assumption. 🙂
––––––––––––––
To illustrate my post, here is an example reflecting what's happening in my development logs. It that particular case, everything looks fine: for each "api_version", different keys are set in Redis regardless of the level of nesting for partials that might exist in different versions.
Of course, feel free to take inspiration from it if you feel it could be a useful addition to the README. 🙂
Main Template
Files
Redis logs on fragment writes/reads
1. additional v2 partial:
_product_category.json.v2.jbuilder
call the endpoint with the Accept header "api_version=1"
1. writes
2. reads (OK, same as writes)
call the endpoint with the Accept header "api_version=2"
1. writes
2. reads (OK, same as writes)
2. additional v2 partial:
_product.json.v2.jbuilder
call the endpoint with the Accept header "api_version=1"
1. writes
2. reads (OK, same as writes)
call the endpoint with the Accept header "api_version=2"
1. writes
2. reads (OK, same as writes)
3. additional v2 partial:
_properties.json.v2.jbuilder
call the endpoint with the Accept header "api_version=1"
1. writes
2. reads (OK, same as writes)
call the endpoint with the Accept header "api_version=2"
1. writes
2. reads (OK, same as writes)
The text was updated successfully, but these errors were encountered: