TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

34 点作者 tjholowaychuk超过 5 年前

7 条评论

jake-low超过 5 年前
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 未加载
pedrocx486超过 5 年前
The title makes it look like wget is obsolete. Why not use the original title?
评论 #20811919 未加载
znpy超过 5 年前
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 未加载
app4soft超过 5 年前
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>
combatentropy超过 5 年前
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 未加载
deedubaya超过 5 年前
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.
enriquto超过 5 年前
wget is not a command, it is a program
评论 #20827837 未加载