Coder Social home page Coder Social logo

Static Site Generation - SSG about qwik HOT 7 CLOSED

builderio avatar builderio commented on May 1, 2024
Static Site Generation - SSG

from qwik.

Comments (7)

mhevery avatar mhevery commented on May 1, 2024 4

Yes, Qwik is designed with SSR/SSG and CDNs in mind.

from qwik.

L1lith avatar L1lith commented on May 1, 2024 4

@mhevery I don't see where this is made clear in the Qwik docs how to do this. Whenever I make a starter it ends up making a server entry point when I run npm build. I would prefer to have a command or some way to output static HTML directly. Maybe thats possible with some tinkering but I'm not sure how to do that.

To me it would make sense for the Qwik CLI to be updated to have a SSG starter option.

Also should this issue be open?

from qwik.

kylecordes avatar kylecordes commented on May 1, 2024 1

Maybe change the meaning of this issue, or make a new one, which is a feature request for such a command line option rather than a question about whether Qwik can do this.

Static generation doesn't pick up all of Qwik’s capabilities, but I think there are use cases where it is very useful. For example: a site which is static for 99% public visitors, served for them from a static CDN, and accommodates 1% logged-in users with client-side hydration.

from qwik.

L1lith avatar L1lith commented on May 1, 2024 1

Maybe change the meaning of this issue, or make a new one, which is a feature request for such a command line option rather than a question about whether Qwik can do this.

I still don't understand how you would do this in Qwik in the first place though

from qwik.

mhevery avatar mhevery commented on May 1, 2024

Yes, this issue was a question please make a new issue.

As of right now when you deploy to Cloudflare/Netlify Qwik will generate pages and cache them. In essence, this will give you a SSG.

If you are looking for a command to just build the system ahead of time (classical SSG) We have not implemented it yet. But would love some contribution. We were thinking of just starting a server and then having a tool that just follows all of the links in localhost and downloads them to local directory. Such as scraper should be easy to write. Would you be up for it?

from qwik.

janat08 avatar janat08 commented on May 1, 2024

Having this dynamic ssg makes it easier to build autocomplete search if every new input leads to redirect that would hit the cache right?

In a proper SSG you'd basically force the crawler to fire a lot of queries into auto complete to build pages for them.

With gatsbyjs you could then prefetch potential next inputs and it would grab the serialized data, would something like this work here?

from qwik.

BerndWessels avatar BerndWessels commented on May 1, 2024

Has there been any progress on this?

I was hoping that resume-ability means in this case that all pages are statically generated and hosted on cloudflare pages as static html files and served directly to the browser. From there they are resumed going through SSR in the cloudflare workers when the user starts interacting with the site in his browser.

That would give us the best performance and lowest use of CPU cycles, right?

Is this the correct way of thinking about it @mhevery ?

from qwik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.