如何解决Prerender.io 的缓存 html 标头被静态标头替换
我有一个 Heroku 应用程序,我向其中添加了 namecheap 域 (https://www.platonic.chat/)。我最近使用 Prerender.io 向应用程序添加了 SEO,因此应用程序上的特定页面具有动态链接预览。但是,namecheap 域不会显示所需的动态链接预览。我可以在我的 Prerender.io 仪表板上看到它正确地缓存了页面,但是当缓存的 html 获取时,缓存的 html 的 <meta>
标记不知何故被静态 index.html 的 <meta>
标记替换获取。
另一个提示是,不使用 namecheap (https://platonic-prod.herokuapp.com/) 的 Heroku 域不存在此问题。在 Heroku 域 (https://platonic-prod.herokuapp.com/c/welcome-to-platonic) 中,所需的标题元标记是:
<meta property=“og:title” content=“Welcome to Platonic”>
.
.
.
但是在 namecheap 域 (https://www.platonic.chat/c/welcome-to-platonic) 中,标题元标记是:
<meta property=“og:title” content=“Platonic”>
.
.
.
"Platonic"
是默认标题,但是当你访问不同的 https://www.platonic.chat/c/*
两种情况下 Prerender.io 获取的 html 的主体是相同的,因此在我看来,某些东西正在替换缓存的 html 的标题。当我使用 Facebook Debugger 和 metatags.io 时,链接预览给出了错误的结果,但当我通过命令行 curl -A Googlebot https://www.platonic.chat/c/welcome-to-platonic
使用 Googlebot 时,它给出了正确的结果。那么为什么向 Heroku 应用程序添加 namecheap 域会在获取缓存时修改缓存的 html?
我正在为 Prerender.io 使用 ExpressJS 中间件,缓存 Angular 页面。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。