In this recipe, we will detail how to dramatically increase the performance of our website by caching both the models metadata used in the ORM and also the results of specific queries. These simple Phalcon capabilities will allow for dramatic improvements to our scaling capabilities.
This recipe uses the Phalcon Developer Tools for building a project skeleton and it will require a database.
In this recipe, we will need to use the acpu
PHP extension.
Follow these steps to complete this recipe:
We need to have an application skeleton for experimentation. If you already have such an application, you can skip this step. Create a project skeleton using the
simple
template:phalcon project cache_data simple
Create the database,
cache_data
:DROP TABLE IF EXISTS 'links'; CREATE TABLE 'links' ( 'id' int(11) NOT NULL AUTO_INCREMENT, 'val' varchar(50) NOT NULL, PRIMARY KEY ('id') ) ENGINE=InnoDB DEFAULT CHARSET...