1 Blog Cacher
Install and customize
Learn how to install, manage and customize the plugin.
Installation
- (Optional) Edit the values in the advanced-cache.php file (define...) for your convenience (see below).
- Create the cache directory /wp-cache/ in your WordPress directory and make it writeable (chmod 777).
- Upload 1blogcacher2.0.php file to /wp-content/plugins/.
- Upload advanced-cache.php file to /wp-content/.
- Add this line to the wp-config.php file BEFORE the last require_once():
define('WP_CACHE', true);
- Activate the plugin and take a look to "Settings » 1 Blog Cacher" in the WordPress panel.
Configuration values
- OBC_EXPIRATION: Cache expiration: number of seconds (3600 by default = 1 hour)
- OBC_CACHE_USERS: Plugin behaviour with registered (and logged-in) users:
- 0: Use no cache
- 1: Use a single global cache
- 2: Use an individual cache for each user (2 by default)
- OBC_CACHE_COMMENTERS: Plugin behaviour with commenters: same values as with OBC_CACHE_USERS (2 by default).
- OBC_CACHE_ERROR_PAGES: Option to cache error pages (status 404): true or false (false by default).
- OBC_CACHE_REDIRECTIONS: Option to cache redirections (status 301 and 302): true or false (false by default).
- OBC_AVOID_TRAILING_SLASH_DUPLICATION: Option to omit url trailing slash ("/") in order to avoid caching the same content twice: true or false (false by default).
- IMPORTANT: Don't set this parameter to true in WordPress 2.3+ or if you are using a plugin that redirects urls with trailing slash.
- OBC_ENABLE_BROWSER_CACHE: Option to allow the visitor browser to cache contents: true or false (false by default).
- OBC_LOOK_FOR_DYNAMIC_CODE: Option to look for dynamic code (mfunc and mclude comments): true or false (true by default).
- IMPORTANT: If you have the Gzip compression enabled and you are not using dynamic code, setting OBC_LOOK_FOR_DYNAMIC_CODE to false will allow the plugin to save from having to read the code cached in plain text and so return directly the compressed content.
- OBC_USE_CACHE_DIRECTORIES: Option to save the cached files in a directory strcuture that mimics the blog urls: true or false (true by default).
- OBC_REJECTED_STRINGS: If the url contains one of those comma-separated strings, that url won't be cached (by default: "wp-").
- OBC_ACCEPTED_STRINGS: Exceptions to the previous rule (by default: "wp-atom.php, wp-comments-popup.php, wp-commentsrss2.php, wp-links-opml.php, wp-locations.php, wp-rdf.php, wp-rss.php, wp-rss2.php").
- OBC_REJECTED_USER_AGENTS: If the user-agent (name of the cient's browser, bot, etc.) contains one of those comma-separated strings, its requests won't be cached, though cached pages will be displayed if they exist and haven't expired (by default: "bot, ia_archive, slurp, crawl, spider").
Dynamic code
In order to prevent certain parts of your pages from being cached, you must set the OBC_LOOK_FOR_DYNAMIC_CODE constant to true and use the mfunc and mclude comments:
<!--mclude /wp-content/plugins/plugin.php--?> <?php include("/wp-content/plugins/plugin.php") ?> <!--/mclude--?>
<!--mfunc your_function()--?> <?php your_function() ?> <!--/mfunc--?>
Hire me
Now I'm available for hiring, detail me your project and I'll send you an estimate.
I work part time to develop a Wordpress Theme for loan related websites such as payday loans and financial blogs.
Become a sponsor
Increase your link popularity and improve your search engine rankings by placing your link in the literally thousands of websites using any of my scripts or themes.
Contact me asking for details.
Any question or comment?
Leave a comment on the weblog or contact me if it's a private matter.
Get the updates
Visit the updates blog or subscribe to any of these feeds: