- How can I remove "Powered by..." from my pages?
- How do I create a language file?
- How do I load modules in a cached page?
- How do I make a Plugin?
- How do I upgrade?
- How long should the headers time to live be set?
- I installed, but am getting SQL errors
- I want to (un)modify the files manually.
- I want to develop a component with Page Cache in mind...
- I want to let users know about PageCache without "Powered by"
- Should I disable Joomla Caching?
- What are these statistics I am seeing?
- What is Cache Time To Live
- What should I do before Installing?
- What should I expect from this component?
- What's the exclude list?
- What's the reset list?
- Where should I put the cache directory?
- Which is better - cache to db, APC or file?
- Why is my page full of garbage characters?
How can I remove "Powered by..." from my pages?
Written by ircmaxellWell, there are two ways to remove this from all of your pages. For a small $10 donation (and your domain name), I will send you a license code that will disable that output. The second option is, since this component is GNU/GPL, to go into the code yourself and remove it! I'd much prefer the donation (since this did take a considerable amount of effort), but it's your choice.
How do I create a language file?
Written by ircmaxellYou can create a language file by opening language.page_cache.php, and translating each entry to whatever language you choose. When you save it, the administration will automatically be in your language! If you e-mail me your language files, I will make them available for download on this site.
How do I load modules in a cached page?
Written by ircmaxellWell, starting in Version 1.0.7, you can load modules into a cached page! (so you can cache the rest of the page, but update any number of module positions!!!). To do that, install or upgrade to Version 1.0.7, and then edit your template file.
Find the line that loads the module position that you want loaded (looks like )... Now RIGHT around it (just outside of the brackets, add the following lines. IT IS IMPORTANT THAT THEY LOOK EXACTLY LIKE THIS. You can change 'left' and '2', but leave everything else exactly the way it is, or it won't work...
Before (NOTE, change left to the position you want, and the number is the style.
<!--CacheLoadModule-left:2:-->
After (This MUST BE EXACT)
<!--EndLoadModule-->
That's it!!! Now all you need to do is save the template, and clear the cache. Those modules should be automatically refreshed (with very little performance loss).
Here's an example... Prior to being modified (what to look for)
<? mosLoadModule('right', -3); ?>
After Modification
<!--CacheLoadModule-right:-3:--><? mosLoadModule('right', -3); ?><!--EndLoadModule-->
Read more...
How do I make a Plugin?
Written by ircmaxellWell, you can manually enter a plugin into the component by clicking "New" in the Reset Lists page. To create a plugin for distribution (I'll host it for free, just e-mail me), follow these easy steps:
Option - Find out what the $option variable is for the component (aka for Joomlaboard $option = com_joomlaboard)
Name - Find out the name of the variable to look for (For $task, this would be 'task')
Task - Find the value of the variable to reset the cache (To reset on $task=='save', set this to 'save')
Plugin Name - Name the plugin (Convention is ComponentName Action)
Desc - Create a description (Convention is ComponentName Action)
Add these into this XML template:
<com_page_cache> <Plugin Name="Plugin Name"> <name>Name</name> <option>Option</option> <task>Task</task> <desc>Desc</desc> </Plugin> </com_page_cache>NOTE: All files submitted for posting will be checked prior to posting! Thanks!!!
How do I upgrade?
Written by ircmaxellTo upgrade, in administration, go to Page Cache-> Configuration. In configuration, make sure "Uninstall database when uninstalling component from Joomla!?" is UN-CHECKED (and saved). Then uninstall the component (make sure index.php, administrator/index2.php and administrator/index3.php are writable when uninstalling). Then install the new version as usual, and the component will automatically be upgraded! That's it!
Read more...
How long should the headers time to live be set?
Written by ircmaxellBy default, the headers time to live is set to 3600 seconds (one hour). The best setting for this depends on which version of PHP you are using. On php4, this should be set high for best performance (The default is good enough). On php5, this setting is pointless. It will still alter how long the headers will last before being recaptured, but the performance gains are minuscule at best.
I installed, but am getting SQL errors
Written by ircmaxellFor some reason, the database did not install. In Joomla administration, go to Components->Page Cache->Install Database. That should manually install the database (or at least show the errors).
I want to (un)modify the files manually.
Written by ircmaxellYou can! All you need to do is edit three files. Here's the code to add (or remove).
| Filename | Code |
| /index.php | before "//Installation Subfolder Check" add require_once( 'components/com_page_cache/page_cache.class.php' );
Before "//Detect First Visit" add global $pageCache; $pageCache->init(); ob_start("jos_page_cache_store");
Before "doGzip();" add ob_end_flush(); |
| /administrator/index2.php | Find "$my = initSessionAdmin(...);" after, add require_once( '../components/com_page_cache/page_cache.class.php' ); |
| /administrator/index3.php | Find "$my = initSessionAdmin(...);" after, add require_once( '../components/com_page_cache/page_cache.class.php' ); |
I want to develop a component with Page Cache in mind...
Written by ircmaxellWell, for most cases, there are no special concerns that need to be take when developing the component. With that said, here are the things to consider.
- You can create a cache reset plugin by using the XML plugin format described in the FAQs. So if you are developing an interactive component, you can have it reset the cache whenever user information is submitted (by having the users add the plugin).
- If your component accepts information outside of the Joomla framework (aka by submitting data to a file other than index.php, such as in AJAX requests or Cron based automation), you have that file clear the page cache. You can do that with the following code:
To clear the cache from another file (note that the $database object MUST be initialized with the default Joomla database.php) :
if(file_exists($mosConfig_absolute_path.'/components/com_page_cache/page_cache.class.php')) {
require_once ($mosConfigure_absoulte_path.'/components/com_page_cache/page_cache.class.php');
global $pageCache;
$pageCache->clear();
}
I want to let users know about PageCache without "Powered by"
Written by ircmaxellWell, I have made a 80x15 "button" for my page_caching component. To display it, just put this where you want it...
<a href="http://www.ircmaxell.com" title="Page Cache!">
<img src="http://www.ircmaxell.com/images/page-cache.png" alt="PageCache" title="Powered By Ircmaxell's Page Cache" height="15" width="80">
</a>It will display this:
If you like this component, let others know!
Read more...
Should I disable Joomla Caching?
Written by ircmaxellNo. This caching component is designed only to work when users are not logged in. The default caching component will speed up Joomla when users are logged on. They will simply work together.
What are these statistics I am seeing?
Written by ircmaxellOn the cached pages listing page, there are a few statistics. Here's what they mean. Cached hits are the total number of times the cached version of the URL was requested. Uncached hits are the total number of times the cached version was expired, and regenerated. Disabled hits are when users are logged on, or the component is disabled. The times next to them are average load times for each category (in seconds).
What is Cache Time To Live
Written by ircmaxellWell, when the pages are cached, the component needs to know how often to reprocess the page. So with the default TTL set at 600 seconds, that means unless the cache is reset, the page will be cached for 10 minutes before being deleted and re cached (this is done to keep pages current). Setting this too low defeats the point of the component. The proper length depends on your page. If content on the page is rarely changed, then set this high. If you have a lot of dynamic content, then you can lower it a little.
What should I do before Installing?
Written by ircmaxellBefore installing this component, you should make sure that the Joomla root is writable (aka the directory where index.php lies), and the administrator directory is writable. Also make sure that /index.php, /administrator/index2.php, and /administrator/index3.php are writable. Then go ahead and install the component! It will automatically attempt to make all necessary file modifications necessary for the component. If it fails to make the modifications, you can make them manually, or fix the problem and select "Modify Files" from the component menu.
Note! You MUST have the follow to install the component
- Access to $_SERVER variables
- If using php4, fsockopen access
- php 4.3.3 or greater
What should I expect from this component?
Written by ircmaxellWell, this component WILL lower page load times for guest users. It will not effect page load times for logged in users in any way. Expect to see a VAST performance gain in busy sites (I have a site running with it that averaged 5 times as many hits before taking the server down). For the BEST performance, I recommend php5.
What's the exclude list?
Written by ircmaxellBasically, the component uses URL based caching. The exclude list allows you to alter caching behavior (changing the lifetime of the cached page, or disabling caching) for URLs that match the conditions. If the condition is a regular expression (regex), the URL is checked for a match for the regex. If the condition is not a regex, then if the URL contains the condition, it will be counted as a match. Note, if a URL matches more than one condition, the one with the lowest TTL will be used. So if your default TTL is 600 seconds, and you have 'forum/' set to '0', then any URL with forum/ in it will not be cached.
What's the reset list?
Written by ircmaxellBasically the component will reset the entire cache if one of the conditions in the reset list is met. There are two ways of setting up a new item. You can download a XML file (from this website), and upload it to install it automatically, or you can manually enter a variable name and value. The option variable allows you to limit the condition to a specific component. The variable setting allows you to choose which variable to test for (depending on which component you are applying this for). The value setting is the value of the variable for which to reset the cache.
Where should I put the cache directory?
Written by ircmaxellWell, since the directory needs to be writable, the best place to put it would be below the document root. So if your document root is /home/something/public_html/, then you could put the cache directory at /home/something/page_cache/. It will work fine above the document root as well. Just make sure this directory is writable, or file based caching will not work.
NOTE: Make sure that this is an absolute path and is writable.
Which is better - cache to db, APC or file?
Written by ircmaxellBe advised that each cached page will take up around 100kb (depending on a lot of factors). So, if your site has 100 pages, that's 10 megs... 1000 pages, 100 megs, you get the idea
APC - The fastest method possible. But it stores everything in RAM, so if you don't have enough, it can push you into SWAP (not a good thing)
Database - Second fastest method. If you have a size limit on your database (as is common in shared enviroments), be aware that the database will get big...
File - Slowest (still faster than core, but slower than the other two). Pretty robust, and since you usually have more storage space than RAM or DB storage, this is prob the best for shared enviroments. Just make sure the server has write access to the directory...
Why is my page full of garbage characters?
Written by ircmaxellVersion 1.0 of the component did not support Gzip page compression. This was fixed in 1.0.1. Upgrade as soon as possible...
com_page_cache








