0

I've got some pages (or "nodes" in Drupal parlance) that have the content of a PHP function which calls an external library to render a HAML template. These nodes (meaning the actual <?php ?> tags and functions to call the library) are stored in the database and go through some sort of eval style call when the page is requested.

If I'm using APC, will the opcodes for the functions stored in the database still cache? Or will it go through a fresh cycle of requesting the library, running the function, generating the output, and storing that to be echoed every time the page is hit?

4

1 回答 1

1

APC 不缓存优化后的评估代码,至少现在还没有。要利用它,您应该将其转储到磁盘。如果代码中没有敏感数据,您可以使用临时文件并仅将文件名/密钥存储在 APC 中以进行检索。然后,您应该仅在更新了在数据库中生成代码所需的信息时才更新文件。

于 2013-02-21T17:53:43.703 回答