3 ms·
Just a question, is it possible to have a website built with Django and still work like the speed of a static site. I've seen all these JAMStack websites marke
by colesantiago 3y ago
Just a question, is it possible to have a website built with Django and still work like the speed of a static site.
I've seen all these JAMStack websites marketed as 'fast' when the only reason they are fast is that these web frameworks (11ty, Astro, Hugo, Gatsby, etc) are essentially static generators to HTML which is pretty much the same as creating a plain html file if you want to.
I'm mainly interested in the SEO and speed side of things but does using a web framework like Django or an SSG make a difference?
- simonw 3y agoComputers are fast these days. If you write efficient code I don't see any reason the difference between a Django site and static files couldn't be imperceptible. Or... run a Django app behind a caching proxy like Varnish or Fastly or Cloudflare. I do that for my https://simonwillison.net/ https://simonwillison.net/ site (Cloudflare) and helped implement Varnish at Eventbrite - it's a really solid pattern.
- nicbou 3y agoThe advantage of a static site is that your server is simple, fast and secure, and requires little to no maintenance.
- EdwardDiego 3y agoDepends on how much work your Django app is doing. There's built-in caching support to make it faster. https://docs.djangoproject.com/en/4.2/topics/cache/ https://docs.djangoproject.com/en/4.2/topics/cache/
- nicbou 3y agoCaching can make it really fast, and this is good if you expect your website to change often (e.g. due to comments). Otherwise static is 100% the way to go, if only to reduce how much code to deploy.