Skip to content
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

11ty edge: problem with size of generated Edge data file #2593

Closed
slegay opened this issue Oct 7, 2022 · 3 comments
Closed

11ty edge: problem with size of generated Edge data file #2593

slegay opened this issue Oct 7, 2022 · 3 comments
Assignees
Labels
feature: 🧀 edge The Eleventy Edge plugin needs-triage

Comments

@slegay
Copy link

slegay commented Oct 7, 2022

Describe the bug
With thousand of pages and personalization of every page based on user permissions at the edge, the edge data file quickly reaches a few megabytes because we need to store build time data to use in edge blocks for every page.

Based on our experience, once the file reaches over a 1MB we start experiencing cold start delays on Netlify and pages crashing for a while until that data gets loaded and available in memory.

We're already using global data for user attributes, icons, incoming query params, cookies, but injecting page contents in the edge function would require making all of that content available at the edge, which isn't practical.

It would be nice if edge data could get stored inside the page built by 11ty instead of a global data file. This would scale much better.

To Reproduce
Create a huge edge data file and try loading a page from Netlify CDN (you cannot reproduce the problem locally using CLI). You'll get a 'Edge function has crashed' error page.

Expected behavior
Page should render

  • Eleventy Version
    2.0.0-canary.16
@zachleat
Copy link
Member

zachleat commented Oct 7, 2022

What template language are you using here? I’d guess that Nunjucks templates scale much worse, as they are required to be precompiled to the data file.

cc @MarcL

@zachleat zachleat self-assigned this Oct 7, 2022
@zachleat zachleat added the feature: 🧀 edge The Eleventy Edge plugin label Oct 7, 2022
@slegay
Copy link
Author

slegay commented Feb 1, 2023

Hey sorry for the delayed reply, I missed your message.

We're using Nunjucks. It just didn't scale, so we refactored our site to not use Netlify edge at this time, we've replaced all that personalization code with web components on the client. It's unfortunate, the tech was really promising, but our data file was getting enormous. We optimized it, but it became so constraining that some of the things we wanted to do were impossible without getting the datafile to become a few megabytes.

We could have split content personalization between 11ty Edge for simple things and client side web components for more advanced contextualized rendering of content, but using 2 different approaches mixing SSR and CSR to solve what is basically the same problem didn't make sense.

So it's all client side for now. I'll keep looking at this though, if this scalability issue gets resolved we're huge fans of 11ty Edge.

@zachleat
Copy link
Member

Per the Eleventy Community Survey results and our refocus and prioritization towards our roots as a static site generator, we’re going to be deprecating Edge in 3.0 and closing issues related to the Edge plugin. I’m very sorry to have to do this—but unfortunately this was a necessary decision to allow the project to continue forward.

Read more:
https://www.zachleat.com/web/eleventy-side-project/
https://www.11ty.dev/blog/community-survey-results/

@zachleat zachleat closed this as not planned Won't fix, can't repro, duplicate, stale Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: 🧀 edge The Eleventy Edge plugin needs-triage
Projects
None yet
Development

No branches or pull requests

2 participants