We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Save compiled volt files in Ram using memcache instead of saving them to hard disck

Dears,

Is it possible to save the compiled volt file (the converted php version) directly to the ram using memcached or volt ?.

I tried to use \Phalcon\Cache\Backend\memcache but it save the final html which means that if the page has a dynamic content it always show the first saved version of the volt file.

Please advise



98.9k
Accepted
answer

Volt does generate PHP files that are cached by a bytecode cache such as APC or ZendOptimizer+ so they are served from RAM as you need.

Thanks for reply.

I need to save them using memcached and as I told you above I tried to use \Phalcon\Cache\Backend\mimcache but it cache the final html not the generated compiled php.



98.9k

We don't have an adapter called \Phalcon\Cache\Backend\mimcache

Hi, you can use RAMFS to serve files from RAM if you want. This can be a bit harder to set up, but it works like a charm :)