使用 memcached 加速 symfony 1.4 模板

发布于 2024-11-09 06:30:05 字数 79 浏览 0 评论 0原文

我想知道是否可以通过在 memcached 中加载文件来加速 symfony 模板,然后从内存中获取它们而不是执行包含?有人试过这个吗?有用吗?

I was wondering if itwould be possible to somehow speed up symfony templates by loading the files in memcached, and then instead of doing include, grabbing them from memory? Has anyone tried this? WOuld it work?

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

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

发布评论

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

评论(2

離殇 2024-11-16 06:30:05

您已经查看过视图缓存了吗?这个内置系统可以缓存操作的输出,并且有很多配置选项,并且可以在每个操作(和每个组件)级别上覆盖。它默认在文件级别工作,但我认为可以以将操作输出缓存到 memcached 的方式对其进行配置。 (或者你应该写这部分)

如果你想要真正快如闪电的页面,你还应该看看 sfSuperCachePlugin ,它将输出作为 HTML 文件存储在公共 HTML 文件夹中。这样 Apache 就可以直接为页面提供服务,而不需要启动 PHP 和 symfony 来生成输出。

Have you looked at the view cache already? This built-in system makes it possible to cache the output from actions, and has a lot of configuration options, and is overridable on a per-action (and per-component) level. It works by default on a file level, but I think it is possible to configure it in a way that the action output is cached to memcached. (Or you should write this part)

If you want really lightning fast pages, you should also look at the sfSuperCachePlugin, which stores the output as an HTML file in your public HTML folder. That way Apache can directly serve the pages, and doesn't need to start up PHP and symfony to generate the output.

少钕鈤記 2024-11-16 06:30:05

抱歉,没有更多时间在这里进行解释,但您可以在以下位置查看注释:

http://www.symfony-project.org/book/1_2/12-Caching

标题下:

替代缓存存储

页面引用:

“默认情况下,symfony 缓存系统将数据存储在网络上的文件中服务器硬盘。可能想要将缓存存储在内存中(例如,通过 memcached)或数据库中(特别是如果您想在多个服务器之间共享缓存或加速缓存删除),您可以轻松更改 symfony 的默认缓存存储系统,因为缓存类。 symfony 视图缓存管理器使用的内容在factory.yml 中定义。”

祝你好运!

Sorry for not having more time to give an explanation here but you can review the notes at:

http://www.symfony-project.org/book/1_2/12-Caching

under the heading:

Alternative Caching storage

Quote from the page:

"By default, the symfony cache system stores data in files on the web server hard disk. You may want to store cache in memory (for instance, via memcached) or in a database (notably if you want to share your cache among several servers or speed up cache removal). You can easily alter symfony's default cache storage system because the cache class used by the symfony view cache manager is defined in factories.yml."

good luck!

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