Skip to main content
2 of 2
added 278 characters in body
andrew.welch
  • 11.6k
  • 24
  • 31

Invalidating the cache tag from a plugin?

I have a plugin that renders HTML via a hook. If someone wraps that hook with {% cache %} in their templates, how can my plugin tell Craft to invalidate the cache when something within it changes?

EDIT: Let's say, for example, that I'm getting JSON data from an external source via my plugin. I could be rendering this via a hook, or using a Variable, it doesn't matter that much.

There's no Element that the content that changes can be linked to, in order to invalidate the cache.

andrew.welch
  • 11.6k
  • 24
  • 31