Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails:在更改内容后公开加载内容文本文件。_Ruby On Rails_Ruby_Ruby On Rails 4_Browser Cache - Fatal编程技术网

Ruby on rails Rails:在更改内容后公开加载内容文本文件。

Ruby on rails Rails:在更改内容后公开加载内容文本文件。,ruby-on-rails,ruby,ruby-on-rails-4,browser-cache,Ruby On Rails,Ruby,Ruby On Rails 4,Browser Cache,我在公用文件夹中有一个文件文本,url类似于“public/text/index.html” index.html <html> <body> <p> hello </p> </body> </html> 你好 当我将此文件的内容更改为: <html> <body> <p> hello World</p> </body> <

我在公用文件夹中有一个文件文本,url类似于“public/text/index.html”

index.html

<html>
  <body>
    <p> hello </p>
  </body>
</html>

你好

当我将此文件的内容更改为:

<html>
  <body>
    <p> hello World</p>
  </body>
</html>

你好,世界

当我在浏览器上显示此文件时(url:
“localhost:3000/text/index.html”
),它会显示旧内容

当我清除浏览器上的缓存时,它会加载新内容。我认为原因在于缓存。
如何在浏览器上加载新内容而不删除?

您需要的是
livereload

当文件更改时,它将自动检测、重新加载服务器并在浏览器中重新加载html

检查和