gpt4 book ai didi

azure - azure blob 存储上的静态 html 文件作为站点架构

转载 作者:行者123 更新时间:2023-12-02 23:32:45 25 4
gpt4 key购买 nike

最近我将网站迁移到 Azure 并了解了 azure blob 存储。我的网站包含很多静态 html 文件。目前,这些文件由内容管理员生成并存储在特定文件夹中,例如/articles/some-article.html。将这些文件存储为 blob 并直接从 CDN 向公共(public)用户提供服务,从架构和 seo 角度来看,这是一个好主意吗? (将链接从 example.com/articles/some-article.html 更改为 cdn.example.com/articles/some-aritcle.html)。

更新

html文件将直接被公众用户使用。他们将通过链接或直接网址访问它们。简单来说,它只是将静态 html 文章/博客文章迁移到 azure blob 存储,而不是将它们保存在网站服务器上的文件夹中。它们是独立的 html 文件,很少被重写。为了进一步说明,用户将浏览动态页面 example.com/articles(mvc 5 网站),并且在该页面中将有一个指向 Blob 的链接列表:

<h1>This is an article about stuff</h1>
<p>description description description description description description description description description description description description </p>
<a href="http://cdn.example.com/articles/article-about-stuff.html">Read more</a>

<h1>This is another article about stuff</h1>
<p>description description description description description description description description description description description description </p>
<a href="http://cdn.example.com/articles/article-about-other-stuff.html">Read more</a>

最佳答案

考虑到您的用例,将这些页面托管在 Blob 存储中是完全有意义的。将它们移至 Blob 存储将释放 Web 服务器上的一些负载(因为现在静态内容将由 Blob 存储提供服务)。此外,启用 CDN 将改善整体用户体验,因为用户将从距离他们最近的节点获得内容。

但是,请记住,您仍然无法使用 Azure Blob 存储托管静态网站,并且如果用户输入了一些不正确的 URL(或者可能会弄乱应用程序中的链接 [只是为了好玩:) ],他们将显示标准 blob 存储错误消息。您无法自定义 blob 存储抛出的错误消息。

关于azure - azure blob 存储上的静态 html 文件作为站点架构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38460636/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com