Swr: Using query params

Created on 5 Nov 2019  路  3Comments  路  Source: vercel/swr

Hi there,

Thanks for this little library ! After exploring the doc I could not find a way to invalidate multiple entries at once. For example, if I've a search bar /projects?description=My Search, when adding a new project I would like to invalidate all /projects/*.

Any idea how this could be implemented?

feature request

Most helpful comment

We've planned to add cache APIs and inactive cache collection. Scenarios like this will be supported soon!

All 3 comments

We've planned to add cache APIs and inactive cache collection. Scenarios like this will be supported soon!

I think this could now be solved with the exposed cache, get all cache keys, filter based on /projects/* glob and then call mutate against them without data to revalidate them or call cache.delete to delete them altogether

Looks good, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DoT214 picture DoT214  路  4Comments

bcomnes picture bcomnes  路  3Comments

timurmaio picture timurmaio  路  3Comments

tiagocorreiaalmeida picture tiagocorreiaalmeida  路  3Comments

dandrei picture dandrei  路  3Comments