I use Devise for authentication on a model that heavily relies on caching. Because of update statements on both sign in and sign out, the cache sweeper for this model gets called on every sign in/out.
Is there a way to filter the origin of the sweeper callback?
I tried skipping the sweeper like this:
The current_sign_in_at and last_sign_in_at are the two fields that are updated by devise during sign_in and sign_out. This code makes the obvious assumption that you have no application logic of your own to update these fields and only devise updates them.