heroku - 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 时,链接预览给出了不正确的结果,但是当我通过命令行使用 Googlebot 时,它给出了正确的结果curl -A Googlebot https://www.platonic.chat/c/welcome-to-platonic
。那么,为什么在 Heroku 应用程序中添加一个 namecheap 域会在获取缓存的 html 时对其进行修改?
我正在为 Prerender.io 使用 ExpressJS 中间件,缓存 Angular 页面。
解决方案
推荐阅读
- regex - 如果它不以其他单词开头,则捕获单词
- maven - 如何从 Maven 中受密码保护的远程服务器获取 Swagger 定义
- c - C中的动态数组push()导致Valgrind错误
- sql - 根据sql中右侧表的条件获取左侧表的ID?
- python - 如果在目录中创建了新文件,则启动 python 模块(看门狗)
- html - 点击图片无法访问链接
- python - 为什么我的 FPS 相机滚动?在 Python 中使用欧拉角(不是四元数)实现
- python - 隔离森林:分类数据
- node.js - puppeteer:无法登录并循环浏览网址
- sql - datediff 奇怪的东西 - SQL Server