Lucie
@nuxtjs/prismic high API usage
Prismic API's cached on Cloudflare CDN and invalidated when new content is published on Prismic. If you want to cache results on Nuxt's end I would look into Hybrid Rendering as suggested above: https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering, @nuxtjs/prismic itself doesn't provide another caching mechanism as those often don't play well with content update
44 replies
@nuxtjs/prismic high API usage
OK, yes!
This sounds all possible then with the setup you shared to me (
usePrismicSlicesResolver
might make a few extra calls based on resources needed by your slices that your developers implemented).
With that in mind I don't think there is anything wrong with your code (like crazy process loops or else), and making ~8 calls to fetch the resources to render your pages sounds alright and typical when augmenting your slices content with extra data. Those calls are also made concurrently which is great to improve your website's speed.
I wouldn't be surprised then if you see your API usage being ~10x your actual website traffic and our API should handle the load without issues (most of them should be cache hit on Cloudflare sitting in front of our API)
If API usage becomes a concerns of your, you could look into Nuxt's hybrig rendering feature (https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering) which could allow you to cache or make static some pages that aren't so dynamic, preventing you from querying Prismic on every visit44 replies
@nuxtjs/prismic high API usage
Oh, sure! Do you have access to the site's source code?
If yes, I'd like to know on your Nuxt pages, for example
~/pages/index.vue
, how data from Prismic are queried, there should like be something like useAsyncData
or at least prismic.client.*
somewhere. If you could share what the code looks like around those that'd be helpful 🙂44 replies
Modifying code in a composable throws error 500 composable is not defined
Tracked it there: https://github.com/nuxt/nuxt/issues/21673
3 replies
Modifying code in a composable throws error 500 composable is not defined
Hey Pin, I thought I was going crazy over a mistake of mine, but I'm experiencing the same issue here, you're not alone ^^
I've tried to look about it for a bit:
- Doesn't seems like a regression, tried on
3.5.3
(latest), 3.5.0
, 3.4.3
, 3.3.3
without luck
- Doesn't seems like something on unimport
, tried with dependency overrides from 3.0.0
to 3.0.8
- Doesn't seem related to top-level App.vue
, same when using page directory
I'll see with the team what's going on here, I still feels like it's something silly, but I'll open an issue if it leans towards a real issue 🤔3 replies