Fix caching of directories and cache invalidation when file is created
The implementation of !55 (merged) was in fact not working: the invalidation of the cache was automatically triggered by swr
(https://swr.vercel.app/docs/revalidation) and not when the socket event was caught.
The socket event was in fact not working for the following reasons:
- I was using
cache.delete
instead ofmutate
- The keys of the cache (that are relative paths) were not corresponding to the keys of the socket payload (that were absolute paths)
I deactivated automatic validation by swr
and fixed 1. in this PR. daiquiri!386 (merged) fixes
2. by sending relative paths (instead of absolute) in the socket payload.