TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pre-rendering static websites with the 23 year-old wget command

34 pointsby tjholowaychukover 5 years ago

7 comments

jake-lowover 5 years ago
Thank you for sharing this; I find the technique refreshingly simple.<p>&gt; You may have seen people achieve this with a more complex headless Chrome-based solution, but for many sites, this will be perfectly fine!<p>Can you elaborate on the difference between using wget and a heavier solution? I assume the main difference is that a headless browser can execute JavaScript and then serialize the resulting DOM back to HTML, allowing you to build sites in client side frameworks (React, Vue) and then make static versions of them for deployment. Are there other benefits of using a full browser vs. simply using wget?
评论 #20816455 未加载
pedrocx486over 5 years ago
The title makes it look like wget is obsolete. Why not use the original title?
评论 #20811919 未加载
znpyover 5 years ago
Wouldn’t it make more sense to generate the html and save it to the appropriate file from the blog generator itself?<p>What if you have a page that is there but it’s not linked from any other page (a landing page for example)? It would never be pre-rendered.
评论 #20845805 未加载
评论 #20814434 未加载
app4softover 5 years ago
It would be interesting to combine <i>wget</i> with <i>HTMLDOC</i>[0] for convert static websites to PDF book.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;michaelrsweet&#x2F;htmldoc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;michaelrsweet&#x2F;htmldoc</a>
combatentropyover 5 years ago
Would it be less maintenance to use your web server&#x27;s cache feature? Both Apache and Nginx can cache dynamic pages to static files.
评论 #20845806 未加载
deedubayaover 5 years ago
Ha, I remember this being a thing to pre-warm caches in java systems a zillion years ago. What was once old is new again.
enriqutoover 5 years ago
wget is not a command, it is a program
评论 #20827837 未加载