Hacker News new | ask | show | jobs
by andybak 4399 days ago
Agreed. Essentially SSGs are caching - or rather they are a way of pushing the caching problem down onto a lower level.

It's no different to 'clear the whole cache every time I change any content and store it all in memcached' - you're just substituting 'file-system' for 'memcached'.

Of course - SSG do solve another problem - that of needing complex software running on your server - you can run SSGs locally or on a centralized server - but that's not what is being discussed here.

2 comments

The crucial difference, as others have pointed out, is that if you start with a dynamic site and add caching, there are a lot of likely gotchas like infinite url's that all load a slightly different page (pagination, tag combinations, etc.), as well as potential security issues when a page is not cached yet, or the cache is busted.

On the other hand, if you start with a SSG, your initial state is that every page is cached and works, and you have to think carefully of adding some kind of pagination mechanism.

As the quote goes, "There are only two hard problems in Computer Science: cache invalidation and naming things." The big benefit of a SSG is that you 'solved' the cache problem, and will immediately be aware of issues there.

> It's no different to 'clear the whole cache every time I change any content and store it all in memcached' - you're just substituting 'file-system' for 'memcached'

There's no reason why the SSG needs to rebuild the entire site if you've only changed one thing.

True but my point still stands - some caches are dumb and some are smart. Some SSGs rebuild everything and some can figure out what needs to be rebuilt.