unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.59k stars 482 forks source link

`swr: false` route rule should disable `cache` too #887

Open issue-up[bot] opened 1 year ago

issue-up[bot] commented 1 year ago

A configuration like this:

    routeRules: {
        "/*": { swr: 3600 },
        "/api/test": { swr: false },
    },

Will still use a cache strategy for /api/test as swr is a shortcut for a number of properties. I think this is a little unintuitive and we can probably improve.

manniL commented 1 year ago

Note to all people finding this issue: The current workaround is setting { swr: false, cache: false } to achieve the desired behavior.