3

I have a view with block display that shows a user's picture and profile info. The view is cached for 1 hour.

How can I expire that cache when the user updates the profile?

3

I ended up using Views Cache Actions. It allows to use rules to expire a specific view or views displays when a certain event occurs (like user profile save).

1

Give it a try Views Content Cache

This module implements a views cache plugin that is aware of content and can provide caching for views, until the content in those views changes.

Since, profile content is saved as a node the above module should work as it tell. Try and let us know !

OR

If above module doesn't address the isue we are looking for then use hook_profile2_update to hook into profile update and use the logic in above module to clear cache of a respective views block.

  • I'm not using Profile2 module so my user profile aren't nodes. But good idea to take a look how it's done in that module. – uwe Sep 26 '12 at 15:19
  • 1
    I looked at the code but the way views builds the cache keys doesn't look trivial to me. – uwe Sep 27 '12 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.