N
Nuxt12h ago
Mads

How do I purge cache defineCachedEventHandler

I use defineCachedEventHandler in a few API's but how do I purge it?
2 Replies
kapa.ai
kapa.ai12h ago
Hi @Mads. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources do not contain explicit information on how to programmatically purge or invalidate the cache for handlers created with defineCachedEventHandler in Nuxt/Nitro. From the available sources, we know that defineCachedEventHandler is used to cache responses for API routes, but there is no documented API or method for purging or invalidating this cache manually. The closest related information is about cache configuration and automatic purging of Nuxt's static and asyncData caches via the purgeCachedData experimental option, but this does not apply to defineCachedEventHandler caches specifically. That option is for client-side data caches, not server API route caches purgeCachedData docs. If you need to control cache invalidation for defineCachedEventHandler, you may need to look for more advanced Nitro or Nuxt documentation, or consider using custom logic for cache keys or cache storage, but this is not covered in the provided knowledge sources. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai12h ago
<@335112909350895632> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?