DEV Community

Cover image for Why static sites are back

Why static sites are back

Wassim Chegham on July 28, 2020

This is a guest post by Debbie O'Brien (@Debs_obrien), the Head of Learning and Developer Advocate at NuxtJS. Static Sites in the '90s ...
Collapse
 
shaijut profile image
Shaiju T • Edited

Nice 😄, Any use cases when we should not use static sites ?

Collapse
 
wassimchegham profile image
Wassim Chegham

I wouldn’t necessarily build an app as a static site app, or a static web app, if your app is rendered on the server (like a Java web app), or if you’re building a monolith app. Also, if you heavily depend on a web server, like Apache or nginx to serve your app. CMS apps are also not suited for static web apps.

Collapse
 
shaijut profile image
Shaiju T

CREATE:Frontend , session as good :)

Collapse
 
shaijut profile image
Shaiju T

So what is the best use cases to build static sites ?

Thread Thread
 
debs_obrien profile image
Debbie O'Brien

Any websites where the content doesn’t change every hour for example. I have built hotel sites, travel agent, the NuxtJS docs, personal websites, websites for companies. Small e-commerce sites. The list goes on.

Thread Thread
 
shaijut profile image
Shaiju T

Thanks, I understand, So now we have Azure Static Web Apps and Azure Functions API, with these 2 technologies we can even create dynamic sites like hotel sites, travel agent, personal websites, websites for companies, Small e-commerce sites etc.

So do we now really need sever side technologies like PHP, Java, C#, Go , instead We can do all things using API isn't ?

Thread Thread
 
debs_obrien profile image
Debbie O'Brien

Exactly

Do we need server side technologies- well we can still write serverless functions in java and go and c# for example but what I think we don't need anymore is frontend and backend code mixed together to create an application. So let the backend create amazing API's which the frontend can use to create amazing apps/sites.

Thread Thread
 
shaijut profile image
Shaiju T • Edited

Thanks, Appreciate, 😄, CREATE:Frontend , session as good :)

Collapse
 
zaidchauhan profile image
Zaid Chauhan

Apart from SEO, why we should invest in server side rendering if we can utilize client (visitor) machine for computation for client side rendering?

Frankly, to me it looks like the trend has been started to monetize hosting business.

Collapse
 
debs_obrien profile image
Debbie O'Brien

yes, great question. If only we could just get rid of the servers but sometimes it is good to have server side rendering for large e commerce sites for example as you need constant data changes per minute and don't want to or can't regenerate the site for every single change. There are ways around this sometimes. For example with Nuxt.js you can have a static site that has part of your site as a spa with a spa fallback so for a travel agent you could have a static site with all the hotel details as static but the booking engine page could be a spa inside the static site and that will be rendered client side and as the results of your search don't need seo a spa fallback works perfect here. hope that helps

Collapse
 
zaidchauhan profile image
Zaid Chauhan • Edited

Thanks for more details, but you can get the same result with something like socket.io (or any bidirectional communication) and that also without regenerating site on client or server side.

It's cool to build static webapp or app with server side rendering, but the usecase (need) is very narrow.

Collapse
 
adriangrigore profile image
Adrian Emil Grigore

I got tired of JavaScript and built mkws.sh/.

Collapse
 
kireerik profile image
Erik Engi

GitHub logo kireerik / refo

A website template for the modern web. ⭐️ Star to support our work!

Refo

A website template for the modern web
Powerful developer experience meets lightweight output

Refo maintainability details Refo package downloads join the Refo community

Refo - A website template for the modern web | Product Hunt

Effortless Static Site Generation with Flexibility

Feeling overwhelmed by the static site generator landscape? Refo offers a refreshingly simple and customizable approach built entirely on Node.js.

Unlike Jekyll, Gatsby, Astro and others, we let you leverage the power of Node.js modules directly. This means you can generate any kind of website you can imagine, all with the flexibility of your favorite Node.js libraries and servers.

Key benefits:

  • Effortless Development: Edit your modules and see instant updates thanks to hot reloading.
  • Unmatched Flexibility: Import SVGs, utilize raw imports, and style your components with ease.
  • Data-Driven Content: Craft resumes, portfolios, or any data-driven website with ease.
  • Highly Customizable: No rigid folder structures, minify class names, or even swap out SolidJS for React – it's entirely up to you.

Go beyond the limitations