New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payload extraction support #14507
Comments
@danielroe @pi0 - Is this something that will be added to bridge? |
@gkweb Actually it is already added in bridge and we started experimenting this feature first with Nuxt 2 infra. Only URLs are little bit different for Bridge renderer to be compatible with Nuxt 2 payload URLs. But I don't see no issue to backport new format as well to bridge and adopting for new output 👍🏼 |
Excellent! Thanks @pi0 |
@danielroe ,So the problem in #14591 is a serious problem that appears on the line. Is there a rude way to temporarily fix the problems we face while we pay attention to this roadmap? |
Would it be possible to disable this feature from Motivation: |
@kemalcany This feature is only usable when SSR is enabled. With BTW also adding new experimental flag to disable for (ssr enabled) deployments nuxt/framework#7588 |
Nice! It's heartwarming to see a reference to the project I made years ago, haha :) Off-topicThere's one crucial thing missing though - passing payload data to all the Here's how I'm going to solve this issue if anyone's wondering (it's not in prod yet):
|
How do we push payloads before generating the routes? Currently, |
how to deal with a caching strategy for all generated payloads.js for each page? they don't have unique hashes |
Same question as @dimasxp, any way to add unique hashes to the payloads or at least inline the payload so it's not cached? |
@dimasxp @kilobyte2007 You should apply same caching strategy of routes to payload routes in CDN configuration. If Only apply permanent caches for |
It'd be nice to have the option to extract payloads only for e.g. |
This comment was marked as duplicate.
This comment was marked as duplicate.
Is this being worked upon atm? |
@pi0 @danielroe Is there any reason, why payload files are not hashed? This can be a rather annoying and dangerous trap, since normally one caches JS files indefinitely with Nuxt3, and it requires some special workarounds to exclude the payload-files from this. And once they are in the browser-cache of the users, they are there to stay, preventing these users to see updated content, even if the cache control headers were updated in the meantime. If it has to be this way, i would definitely recommend adding a special notice in the docs (e.g. on https://nuxt.com/docs/api/commands/generate). |
I've run into a similar issue with the payload extraction being cached indefinitely. Here's an example of what is happening with the caching and how it's a problem. We have a blog site with an index page showing the 10 most recent posts: post numbers 10-1 listed in that order
SSG creates static HTML which has these 10 posts in this order, and a matching When a new post is created and the SSG is re-run, new HTML is created which lists the new 11th post, and post 1 is bumped off to the next page:
A matching Unfortunately, this is where we run into problems. When a user visits the site they get the static HTML of posts 11-2. If they had visited the page before, they still have the old |
Is there any news on this? Thank you in advance! |
I have a project where I want to only make fetch requests at build time for a subset of pages. Right now, when navigating to a page, the fetch requests are made on the client even if I took a stab at enabling payload extraction in hybrid mode, i.e. making it work when using main...unshame:nuxt:hybrid-payload-extraction It seems to work, but the problem with it is there's no way to tell from the frontend if a route is prerendered or not. So with these changes, when |
I have the exact same question as @oezkancodes. Is this even needed any more? Some guidance here is much appreciated! |
I also had same question, i started a discussion about it here: Seems like there is a proposal that would add some flexibility for this as commented in a reply. |
Do you think it would be possible to add a hash to the extracted payload like you do with component island? |
@fabianwohlfart Follow #15427 |
In Nuxt 2, we introduced a major enhancement to static generation referred to as Full Static Generation inspired by DreaMinder/nuxt-payload-extractor. You can read more about the history of initial decisions in nuxt/rfcs#22 which finally landed by #6159 in 2.13.0 and being available by opt-in option
target: 'static'
.In Nuxt 3, thanks to nitro we can move payload extraction to the next level to not only support it for a static generation but also the hybrid static mode and even prefetching payload of server-rendered components. We initially tested this enhanced functionality using Nuxt bridge (src) and @danielroe made a POC in danielroe/nuxt-full-static for Nuxt 3 userland implementation.
Using this issue to track the progress of the core implementation roadmap.
<nuxt-link>
framework#4329)Needs route rules:
The text was updated successfully, but these errors were encountered: