作为构建的一部分,如何将 ASP.NET 页面转换为静态页面?

发布于 2024-10-09 14:09:13 字数 202 浏览 0 评论 0原文

我有一些完全静态的页面。它们仅在构建时更改。但它们的创建成本很高。对于创建成本较高的那些,我使用 ASP.NET 输出缓存将它们缓存很长时间。但对于一个页面,我真的希望它永远缓存或直到下一个构建。

实现这一目标的最便捷方法是什么?是否有内置功能或第三方工具可以实现此目的?

(是的,目前我计划执行“查看源代码”并复制粘贴操作,这不是一个非常优雅的构建步骤)

I have a few pages that are completely static. They only change at build time. But they are expensive to create. For the ones that are kind of expensive to create, I cache them for very long times using the ASP.NET output caching. But for one page, I really want it cached forever and ever or until the the next build.

What is the most expedient way to make this happen? Is there a build in feature that achieves this or a third party tool?

(yeah, for the moment I plan to do the "view source" and copy paste thing, which isn't a very elegant build step)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自此以后,行同陌路 2024-10-16 14:09:13

您是否考虑过设置内容过期时间,让浏览器不再请求该页面?您可以将版本号附加到 url 中,以便在下次构建后可以再次请求该页面。

Have you thought of setting content expiry for the browsers not to request this page again at all? You can append version number to the url so the page can be requested again after next build.

小女人ら 2024-10-16 14:09:13

为页面提供 .html 扩展名,您可以使用 T4 模板< /a>

Give the page a .html extension, you can generate the .html using a T4 template

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文