OverviewObjectiveLearn how configure and initialize PVCache inProdigyView..Requirements Basic Understanding of Cache and Memcache in ProdigyViewEstimated Time5 Minutes
Follow Along With Code Example1. Download a copy of the example code at www.prodigyview.com/source.2. Install the system in an environment you feel comfortable testing in.3. Proceed to examples/system/Cache_Configuration.php
Disable BootstrapThe first thing we need to do is disable initialization of thecache on the bootstrap.
Set Up the OptionNext step is to set up the default options. Every time youexecute a PVCache::writeCache(),PVCache::readCache() or the other methods inPVCache , these options act the default value.
Cache LocationCache location is the default location on the server wherethe cache will be saved if you use the file cache.
Cache FormatOur cache format is a date and time format set in thecache. The default format is:The dates are generated with PHP date() function, whichmean you can change it to any value that is accepted intothat function.
Cache Format SearchThe format search is a regular expression that will look forthe date/time format with the cache named appended toit.This mean that if you change the cache_format, you alsohave to change the format search to regular expressionthat matches your new date/time format.
Enclosing Tags The enclosing tags are the tags to surround the cache name and the cache date.Applying the closing tags above with return the cache toresemble a format similar to this. Cache Name Date/Time Format Enclosing Tags
Cache NameThe cache name is the name associated with formatteddate in the cache.Modifying the name with PVCache::writeCache() willallow you to have multiple caches in one file.
Cache ExpireThe cache expire, is the expiration in seconds of when thecache will expire from the time that is it set.You want to find a value that is optimal to your server setupand the type of content you are delivering.
Memcache ServersMemcache cache option is the server(s) that are usedwhen using memcache on your site.As many servers as you want can be added in an arrayformat, but not every server needs to connect. Theconnection works just like regular memcache. See the apifor the values that can be passed when adding a server.
Final StepThe final step is passing the array of configured optionsinto the init function and you are done. You havesuccessfully configured the default values for the entirePVCache class.
API ReferenceFor a better understanding of cache in ProdigyView, visitthe api by clicking on the link below.PVCache More TutorialsFor more tutorials, please visit:http://www.prodigyview.com/tutorials www.prodigyview.com