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
classFruitLoops < ApplicationRecordafter_create:prime_cache,type: :create,serializer: ToucanSamafter_update:prime_cache,type: :update,serializer: ToucanSamafter_destroy:prime_cache,type: :destroy,serializer: ToucanSam# or possiblyafter_commit:prime_cache,serializer: ToucanSam
...
end
This way you would be invalidating your cache and creating a new one on every CRUD action so that you'd nearly always be getting a cached result from the serializer.
In concert with this functionality, it would be nice to have a rake task to prime all of the caches initially.
The text was updated successfully, but these errors were encountered:
That's a good thought, but this could also be implemented as a simple method like this right?
defprime_cacheToucanSam.new(self).as_jsonend
That being said, it also seems like it would be just as easy to add to the gem. If there is enough demand for it, I'd be happy to add it in or accept a PR.
This way you would be invalidating your cache and creating a new one on every CRUD action so that you'd nearly always be getting a cached result from the serializer.
In concert with this functionality, it would be nice to have a rake task to prime all of the caches initially.
The text was updated successfully, but these errors were encountered: