Internetak
Internetak
NNuxt
Created by Internetak on 5/8/2024 in #❓・help
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?
1 replies
NNuxt
Created by Internetak on 2/21/2024 in #❓・help
Api request in nuxt takes too long to process
No description
6 replies