Tuesday 15 July 2014

cakephp - Display expired cache file when database/source is unavailable -


I have a controller where the cake is being cached using the PHP cache helper:

  public $ cacheaction = array ('index' = 3600);   

At the end of the cache, the KPHP will try to establish a connection with the source (database or external feed). If the source is unavailable, it will inform the user that the connection is not available. Instead, I would like to follow two things:

  1. Instead of displaying a "no connection" error, I can display the current cache file (end cache) until the database / source connection is restored Would like to Once the connection is restored, a new cache is generated.
  2. Capture the missing connection in the background and email the web admin.

    Thanks for your time!

    As far as I know that the cake allows you to build a cache engine, which you can expand by using And the work of reading is expanded by the functionality you have mentioned, this should solve your problem, the only thing that concerns me is that the book does not catch if the caching assistant uses the rest of the catch engines Does the app, lake By assuming, I guess this will be the only logical solution.



No comments:

Post a Comment