N
Nuxt7mo ago
Internetak

When have swr (route cache) enabled for path, i cant get user-agent from header

Hello, When i set swr to true or setup cache in routeRules in nuxt.config.js for route path like that:
'/': {
cache: {
maxAge: 60,
base: "redis"
}
},
'/rank/**': {
swr: 60
},
'/': {
cache: {
maxAge: 60,
base: "redis"
}
},
'/rank/**': {
swr: 60
},
When i use useRequestHeaders() it's always empty. I need to check user-agent to check if user is on mobile on desktop to use different layout. Is it possible to for example set cache key with user-agent or serve different layout with swr based on user-agent?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server