Configuring Form Cache Generation Timing

From IHRIS Wiki
Revision as of 15:56, 26 February 2010 by Lduncan (talk | contribs) (Created page with 'Cached forms are used to save forms to a consistent format for exporting and for generating custom reports more quickly. There are a few settings you can override in your site c…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Cached forms are used to save forms to a consistent format for exporting and for generating custom reports more quickly. There are a few settings you can override in your site configuration file to change this behavior. You can also see how to Turn Off Background Processes if you wish to not have the form caches update automatically.

Configuration Settings

/modules/CachedForms/times/background_time
Default value: 0
This determines how much time in minutes that must pass before the background process starts to cache all forms if they are stale. This just causes the background process to spawn, the process itself determines what needs to be updated based on the other timing settings. If you set this to 0 then the background process will never start. This is currently the default behavior because the Custom Reports module automatically updates any form caches it needs for each individual report when it runs either by background process, the command line or from generating the report through the Custom Report interface. This doesn't mean that the caches will be run every X minutes, but if X minutes have passed the next time someone access the site the background process will be launched.
/modules/CachedForms/times/stale_time
Default value: 10
This determines how much time must pass in minutes before a form is determined to be stale. So if a form was cached 5 minutes ago and the setting is 10 then it won't try to cache it when the caching starts. You can also force the cache generation to ignore this time. If the setting is 0 then the forms will always be considered stale.
/modules/CachedForms/times/fail_time
Default value: 15
This determines how much time must pass in minutes before it's determined that the last cache form command has failed and should be restarted. If you have a lot of data and lots of activity you may want to increase this time because it may take a while to run the form caches.
/modules/CachedForms/times/recache_time
Default value: 1440
This determines how much time must pass before the entire form cache is dropped and recreated. This is to avoid issues with the cache getting out of sync either from manually importing and dropping data or other errors.
/modules/CachedForms/times/stale_time_by_storage
Default values:
  • entry:10
  • magicadata:30
  • flat:20
  • mutli_flat:20
This overrides the stale_time setting based on the storage mechanism for the form. Some form storage mechanisms may not be changed as often so the cache won't need to be updated as frequently.
/modules/CachedForms/times/stale_time_by_form
Default values: person:3
This overrides the stale_time and stale_time_by_storage settings based on the individual form. Some forms may need to be updated more frequently like the person form since it may be used more frequently.

Configuration Example

You can add the following to your site config file to override these settings. You can add in only the settings you wish to change.

<source lang="xml"> <configurationGroup name="CachedForm_times" path="/modules/CachedForms/times">

 <displayName>Times</displayName>
 <configuration name="background_time">
   <displayName>Stale Time</displayName>
   <description>The time (in minutes) after which to launch the background page.  
     You can disable the launching of the background page by setting this to be less 
     than or equal to 0
   </description>
   <value>0</value>
 </configuration>
 <configuration name="stale_time">
   <displayName>Stale Time</displayName>
   <description>The time (in minutes) after which a cached table is consider stale.    
     Setting to be less than or equal to zero means that it is always considered stale.
   </description>
   <value>10</value>
 </configuration>
 <configuration name="fail_time">
   <displayName>Fail Time</displayName>
   <description>The time (in minutes) after which generation of a cached table is consider to have failed</description>
   <status>required:true</status>
   <value>15</value>
 </configuration>
 <configuration name="recache_time">
   <displayName>Fail Time</displayName>
   <description>The time (in minutes) after which the cached table is recached</description>
   <status>required:true</status>
   <value>1440</value>
 </configuration>
 <configuration name='stale_time_by_storage' values='many' type='delimited'>	
   <description>The default stale time in minutes for a form based on its storage mechanism.  
     If set, overides the value under times/stale_time.    Setting to be less than or equal to 
     zero means that it is always considered stale.
   </description>
   <value>entry:10</value>
   <value>magicadata:30</value>
   <value>flat:20</value>
   <value>mutli_flat:20</value>
 </configuration>
 <configuration name='stale_time_by_form' values='many' type='delimited'>
   <description>The default stale time in minutes for a specific form.  If set, overides the 
     value under times/stale_time_by_storage and times/stale_time.  Setting to be less than or 
     equal to zero means that it is always considered stale. 
   </description>
   <value>person:3</value>
 </configuration>

</configurationGroup> </source>