Documentation


SEARCH

TABLE OF CONTENT

    1. Getting started 2. Basic concepts 3. Request dispatching 4. Context container 5. Dual MVC 6. Component model: 7. Security 8. Configuration 9. Session handling 10. I18n 11. Cache 12. Logging 13. Error handling 14. Advanced Topics 15. API reference

      Tutorials: Frequently Asqued Questions

      See also:


      Caching the model

      Improving the model performance

      Table of Contents

      Caching the model

      Model layer allows to declare caching properties associated to model services (within the /app/config/model_services.xml) by using the cache and cache-ttl attributes at service level.
      i.e.

      1. <?xml version "1.0" standalone="yes"?>
      2.  
      3. <configuration>
      4.  
      5.   <model-services>
      6.  
      7.     <!-- Invoice services -->
      8.     <class name="InvoiceDao">
      9.       <service name = "getAllInvoices" 
      10.        class-method = "loadAll"
      11.               cache = "true" 
      12.           cache-ttl = "300"/>
      13.           
      14.       <service name = "getInvoice" 
      15.        class-method = "load" 
      16.               cache = "true" 
      17.           cache-ttl = "60"/>
      18.       
      19.       <service name = "saveInvoice" class-method = "save"/>
      20.     </class>
      21.     
      22.   </model-services>
      23.   
      24. </configuration>
      In this example, we are caching the getAllInvoices service to expire after 300 seconds (ttl), as well as the getInvoices with a ttl of 1 minute

      The cache-ttlis optional, being 0 by default, forcing the cache to never expire For more information regarding the model, please see the The Model section.