Dovendyret
Dovendyret
NNuxt
Created by Dovendyret on 7/2/2024 in #❓・help
Trigger page-reload on new deployments
Alright thanks a lot! I haven't thought of the possbility of a reload-loop if my frontend sees different versions of my backend. Wouldn't it still techincally be possible to trigger multiple reloads in a row if my frontend detects a new server A build, reloads and reaches server B which is still deploying? We haven't had the need for more than 3 servers so far but definitely a good point. As for the endpoint I think I thought too hard about it. Simply returning a string set during build time and caching it for a short duration seems like a simple and easy solution.
7 replies
NNuxt
Created by Dovendyret on 7/2/2024 in #❓・help
Trigger page-reload on new deployments
@Single Thanks for the reponse! It seems you have good knowledge so sorry for ping but I what do you think about this approach? I have an external Laravel backend running but I'm proxying all my requests through Nitro to this external backend. I could easily create an endpoint for this my question would then be where to store the "deployment ID" for optimal performance? I'm thinking of two options either KV storage in Nitro or just a static file in the assets/ folder. I assume 100k users polling my KV storage could become quite expensive so static json file seems the best? I'm thinking a deployment script that creates a file in the assets/ directory with a deployment ID and then an endpoint like this: export default defineEventHandler(async () => { const data = await useStorage('assets:server').getItem(deployment.json) return data }) that will be polled by my frontend like this: export default defineNuxtPlugin(() => { const { deploymentId } = useRuntimeConfig().public const interval = setInterval(async () => { const response = await $fetch('/deployment') if (response.deploymentId != deploymentId) { reloadNuxtApp() clearInterval(interval) } }, 5000) })
7 replies
NNuxt
Created by Rocs on 6/27/2024 in #❓・help
Best way to cache a pre-rendered SSG project?
I've had the same issue. We have an ecommerce shop with 12 different languages and a lot of SEO content for each language. I've tried pre-rendering all my SEO pages which is around 40k pages and then my server also runs into memory issues. Pre-prendering this content would be preferable but for now we settled for SWR with redis
11 replies
NNuxt
Created by Dovendyret on 5/21/2024 in #❓・help
I18n configuration server-side
I ended up including the i18n configurations in runtimeConfig. Not sure if it's the most optimal way of doing it but it works for my purpose:
export default defineNuxtConfig({
i18n: require('./nuxt.i18n.config'),

runtimeConfig: {
i18n: require('./nuxt.i18n.config'),
},
})
export default defineNuxtConfig({
i18n: require('./nuxt.i18n.config'),

runtimeConfig: {
i18n: require('./nuxt.i18n.config'),
},
})
2 replies
NNuxt
Created by Dovendyret on 4/30/2024 in #❓・help
Pre-render stragety for CMS content
Alright thanks for the tips 🙂 I think my solution would quickly become pretty complicated. I will do some research,
7 replies
NNuxt
Created by Dovendyret on 4/30/2024 in #❓・help
Pre-render stragety for CMS content
Hmmm do you have any idea about the overhead for pre-rendering a few thousand pages? 😄 If we assume we would never reach above 10k would this even be relevant?
7 replies
NNuxt
Created by Dovendyret on 4/30/2024 in #❓・help
Pre-render stragety for CMS content
Thanks for reponse 🙏 Yes I'm thinking our own custom module with this logic would be a potential solution for us. Do you have any tips for how I should retrieve the already generated pages from a previous deploy?
7 replies
NNuxt
Created by Dovendyret on 3/9/2024 in #❓・help
How to add meta data to specific slugs in a dynamic route
Love the YouTube vids btw!
20 replies
NNuxt
Created by Dovendyret on 3/9/2024 in #❓・help
How to add meta data to specific slugs in a dynamic route
Aha okay thank you 🙏 I will try this tomorrow
20 replies
NNuxt
Created by Dovendyret on 3/9/2024 in #❓・help
How to add meta data to specific slugs in a dynamic route
Would the extra http request affect performance in any way? Assuming the response is always cached in redis next my nuxt server?
20 replies
NNuxt
Created by Dovendyret on 3/9/2024 in #❓・help
How to add meta data to specific slugs in a dynamic route
Yea maybe that is good
20 replies
NNuxt
Created by Dovendyret on 3/9/2024 in #❓・help
How to add meta data to specific slugs in a dynamic route
And use swr for that
20 replies
NNuxt
Created by Dovendyret on 3/9/2024 in #❓・help
How to add meta data to specific slugs in a dynamic route
Maybe I could create a nuxt endpoint
20 replies
NNuxt
Created by Dovendyret on 3/9/2024 in #❓・help
How to add meta data to specific slugs in a dynamic route
Yea I have the endpoint already. The problem is the CMS is slow as hell and the underlying dstatructure for the pages is a mess... If I don't hit a cache the response time can be upwards 20-30 seconds to get 3000 slugs 😅
20 replies
NNuxt
Created by Dovendyret on 3/9/2024 in #❓・help
How to add meta data to specific slugs in a dynamic route
The thing is i want to set the correct layout before the CMS response.... This way I won't have to block navigation until my CMS response is resolved 🤔
20 replies
NNuxt
Created by warflash on 7/7/2023 in #❓・help
Broken Plugin Types
Hmm then Im not sure. I had this issue and fixed it by updating Nuxt and VScode to latest and running it on Windows localhost.
11 replies
NNuxt
Created by warflash on 7/7/2023 in #❓・help
Broken Plugin Types
We had the same problem when running Nuxt in a Docker through WSL
11 replies
NNuxt
Created by warflash on 7/7/2023 in #❓・help
Broken Plugin Types
@MateiN What is your development setup like?
11 replies
NNuxt
Created by Thijs on 7/27/2023 in #❓・help
How to handle private keys.
I found the Nuxt API Party module to be great for handling secret API keys. You could look into that.
27 replies