【问题标题】:robots.txt not updating for rails heroku approbots.txt 没有为 rails heroku 应用程序更新
【发布时间】:2020-06-30 23:51:08
【问题描述】:

我在 Heroku 上托管了一个 Rails 应用程序,我正在尝试为其更新 robots.txt 文件。

早些时候,在我的production.rb 中,我有:

config.static_cache_control = "public, max-age=2592000"

但是,我把它改成了:

config.static_cache_control = "public, max-age=0"

并将代码再次推送到生产环境。

我也尝试过运行: Rails.cache.clearheroku rails console 中,但 /robots.txt 仍在显示旧文件。

编辑:

我已从 public 文件夹中删除了“robots.txt”文件。 再次清理和预编译资产,也没有用。

我仍然可以在生产环境中访问它。

【问题讨论】:

  • 如何在应用程序中进行缓存?您是否在production.rb 中设置了config.cache_store

标签: ruby-on-rails heroku caching


【解决方案1】:

我发现了问题,缓存在我的 chrome 浏览器中。

当我在其他浏览器上查看该网站时,robots.txt 已更新。

所以,我清除了 chrome 浏览器的缓存和 cookie,并刷新了 /robots.txt,瞧!文件已更新。

【讨论】:

    猜你喜欢
    • 2014-06-16
    • 1970-01-01
    • 2013-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-10
    • 2020-03-23
    • 1970-01-01
    相关资源
    最近更新 更多