标题几乎描述了我的整个问题。 因为现在我想知道通过将我的静态图像上传到 heroku 或亚马逊的 s3,我的应用程序是否更快。
最佳答案
根据 Heroku 开发中心,Aspen 和 Bamboo 堆栈上的 Heroku 应用程序使用 Varnish缓存应用程序的输出。在 Cedar 堆栈上,必须使用 rack-cache
和 memcache 附加组件。如果您使用的是 Aspen 或 Bamboo,这里有更多信息:
Anything that is served from the filesystem (a Rack::File) is cached for 12 hours. Whenever you push changes, your cache is cleared (see below), and since Heroku filesystems are read-only, it’s safe to cache these for a long period.
然而他们在旁边提到:
Large static assets, such as MP3s or PDFs, should generally not be included in your code tree. Use an external asset hosting service such as Amazon S3, instead. See this article for more information.
关于ruby-on-rails - 如果静态图像是从亚马逊的 S3 云服务器加载的,它们是否会被 Heroku 缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8639594/