2. Overview
Objective
Learn how configure and initialize PVCache in
ProdigyView..
Requirements
Basic Understanding of Cache and Memcache in
ProdigyView
Estimated Time
5 Minutes
3. Follow Along With Code
Example
1. 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
5. Set Up the Option
Next step is to set up the default options. Every time you
execute a PVCache::writeCache(),
PVCache::readCache() or the other methods in
PVCache , these options act the default value.
6. Cache Location
Cache location is the default location on the server where
the cache will be saved if you use the file cache.
7. Cache Format
Our cache format is a date and time format set in the
cache. The default format is:
The dates are generated with PHP date() function, which
mean you can change it to any value that is accepted into
that function.
8. Cache Format Search
The format search is a regular expression that will look for
the date/time format with the cache named appended to
it.
This mean that if you change the cache_format, you also
have to change the format search to regular expression
that matches your new date/time format.
9. 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 to
resemble a format similar to this.
Cache Name Date/Time Format
Enclosing Tags
10. Cache Name
The cache name is the name associated with formatted
date in the cache.
Modifying the name with PVCache::writeCache() will
allow you to have multiple caches in one file.
11. Cache Expire
The cache expire, is the expiration in seconds of when the
cache will expire from the time that is it set.
You want to find a value that is optimal to your server setup
and the type of content you are delivering.
12. Memcache Servers
Memcache cache option is the server(s) that are used
when using memcache on your site.
As many servers as you want can be added in an array
format, but not every server needs to connect. The
connection works just like regular memcache. See the api
for the values that can be passed when adding a server.
13. Final Step
The final step is passing the array of configured options
into the init function and you are done. You have
successfully configured the default values for the entire
PVCache class.
14. API Reference
For a better understanding of cache in ProdigyView, visit
the api by clicking on the link below.
PVCache
More Tutorials
For more tutorials, please visit:
http://www.prodigyview.com/tutorials
www.prodigyview.com