How to store data in cache in symfony2
If you want to store this information in a file you manually create in the app/cache folder, you may use the following solution: https://stackoverflow.com/a/13410635/1443490
If you don't want/need to care about what folder is used inside the app/cache folder and your project already uses Doctrine, you can follow this solution: https://stackoverflow.com/a/8900283/1443490