Possibility to configure TTL for file system #290
Replies: 2 comments 5 replies
-
Hi @MauriceArikoglu! I've been thinking about this feature since the beginning of the year. It's a complicated task because the revalidation period information is not stored in cache values that are saved in the file system. However, this feature is vital and will be the next big thing before we release version 1.0.0. It is recommended to avoid using TTL features with Pages Router. Instead, use the Key Eviction feature if Redis is used as a cache store. The LRU strategy is the recommended approach. One hack could help, but I must test it first. Please stay tuned for updates on this discussion. Thank you very much for using the library and providing feedback! |
Beta Was this translation helpful? Give feedback.
-
@MauriceArikoglu I've found that you can use arbitrary This code works: export async function getStaticProps() {
const result = await fetch('...');
const parsedResult = await result.json();
return {
props: {
// ...
},
revalidate: parsedResult.revalidateValueFromBackend,
};
} Even if it is not a common setup, we can not fully rely on parsing source files with the |
Beta Was this translation helpful? Give feedback.
-
When using a cache handler with
useFileSystem
set totrue
the handler falls back to serving content from the disk. Is there a possibility to set a TTL for file system data? How can I control the duration of serving from cache and still use the file system cache (we need to because of pages router vercel/next.js#58094)Beta Was this translation helpful? Give feedback.
All reactions