生产模式下的 config.cache_classes = true 在 IE 中存在问题

发布于 2024-09-02 05:07:58 字数 555 浏览 0 评论 0原文

在我的 Rails 应用程序中。我正在使用 link_to_function 在一页中引入 ajax 选项卡。在 Moazilla 和其他浏览器中一切正常。但在 IE 中,仅当服务器在生产模式下启动时,选项卡才会加载(无论是 webrick 还是 mongrel)。在开发模式下一切都很好。 时,我发现问题出

config.cache_classes = true

在 app/config/environments/Production.rb 中的

所以当我将上面的代码更改为

config.cache_classes = false

一切正常 一行上。 所以我认为缓存会导致 Rails 出现问题。 当我用谷歌搜索这个问题时,我发现很多都存在缓存问题。 所以我的问题是

1)还有其他解决办法吗?

2) 此修复 (config.cache_classes = false) 是否会导致任何性能问题。如果那么如何克服呢?

欢迎任何意见和建议。

技术日志

In my rails app. I am using link_to_function to bring an ajax tabs in one page.Everything works fine in Moazilla and other browsers. But in IE the tabs are not loading only when the server is started in production mode(doesn't matter whether it's webrick or mongrel). In development mode everything is fine. So I figured out that the issue was with one line

config.cache_classes = true

in app/config/environments/production.rb

when I changed the above code to

config.cache_classes = false

everything works fine.
So I assume caching causes problem in Rails.
When I Googled about this I found many have the issues with caching.
So my question is

1) is there any other fix for this?

2) Does this fix (config.cache_classes = false) causes any performance issues. If then how to overcome that?

Any comments and suggestions are welcome.

Techno_log

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2024-09-09 05:07:58

cache_classes 是告诉 Web 服务器是否应该为每个请求重新加载整个应用程序的设置。更准确地说:

“是否应该缓存类(如果您希望在每个请求上重新加载应用程序类,则设置为 false)”

(来自:http://api.rubyonrails.org/classes/Rails/Configuration.html)

将cache_classes 设置为 false 将对您的应用程序性能产生很大影响。

但是,您的问题很可能与此设置无关。我建议您查看 IE 缓存(即尝试清除缓存),也许是您在生成页面时设置的一些缓存标头等。

此外,所有其他浏览器从服务器获得良好响应的事实意味着 Web 服务器正在生成良好响应。

cache_classes is setting that tells web server if it should reload whole app for each request. More precisely:

"Whether or not classes should be cached (set to false if you want application classes to be reloaded on each request)"

(from: http://api.rubyonrails.org/classes/Rails/Configuration.html)

Setting cache_classes to false will have big impact on your app performance.

However, your problem, most likely, is not related to this setting. I suggest that you take look at IE cache (i.e. try clearing out cache), maybe some caching headers you are setting when generating page, etc.

Also the fact that all other browsers get good response from server means that web server is generating good response.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文