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
Right now RocketPants only supports caching collections using "expires in". I would like to add the option to cache collections with etags. There have been several approaches:
in my controller (I am using Rabl instead of Active Record Serializers, so I don't use exposes). As you see, I am passing my collection and indicate that it's a singular resource, thus triggering the etag caching. Then I use the following to monkeypatch ActiveRecord::Relation to expose a cache_key and rp_object_key:
Would you be open to adding an option where RocketPants would check the collection for a cache_key, use etag caching if it has one and "expires in" if not?
The text was updated successfully, but these errors were encountered:
Right now RocketPants only supports caching collections using "expires in". I would like to add the option to cache collections with etags. There have been several approaches:
I am testing this right now by calling
in my controller (I am using Rabl instead of Active Record Serializers, so I don't use
exposes
). As you see, I am passing my collection and indicate that it's a singular resource, thus triggering the etag caching. Then I use the following to monkeypatchActiveRecord::Relation
to expose acache_key
andrp_object_key
:Would you be open to adding an option where RocketPants would check the collection for a
cache_key
, use etag caching if it has one and "expires in" if not?The text was updated successfully, but these errors were encountered: