Jinx Fast-Cache

Beschreibung

Jinx Fast-Cache provides a very simple but efficient way of full page caching to WordPress.
It will generate static HTML files which will be called using your apaches rewrite rules.
This feature will bypass the whole PHP process and render only a simple HTML file without the whole overhead.

Usage

After activating the plugin, it will modify your htaccess file. If this is not possible, make sure to enter the rules by yourself:

# BEGIN Jinx Fast-Cache
RewriteEngine On
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/wp-content/jinx-fast-cache/%{HTTP_HOST}/%{REQUEST_URI}/%{QUERY_STRING}/index.html -s
RewriteCond %{REQUEST_METHOD} GET
RewriteRule .* /wp-content/jinx-fast-cache/%{HTTP_HOST}/%{REQUEST_URI}/%{QUERY_STRING}/index.html [L]
# END Jinx Fast-Cache

When using nginx, make sure to add the following rules:

set $cache_path false;
if ($request_method = GET) {
  set $cache_path /wp-content/jinx-fast-cache/$host/$uri/$args/index.html;
}
location / {
  try_files $cache_path $uri $uri/ /index.php?$query_string;
}

You may flush, warm or refresh (flush & warm) single or multiple URLs using the buttons in the admin bar.

By default all posts will be automatically warmed after they have been saved and flushed after they have been deleted or put on draft.

The warm process will create a queue which will be handled in a scheduled task (cron). When warming up a single post, it will skip the queue.

Developers

Filters

Jinx Fast-Cache is made for developers. So far no admin panel is available, but you may modify a lot of it’s behaviors using filters.

  • jinx_fast_cache: Return true (default) or false to control, if a URL should be cache or not.
  • jinx_fast_cache_post_types: Control the post types which should be cached. By default all post types which are „publicly_queryable“ and „page“ will be cached.
  • jinx_fast_cache_posts: Filter the posts which should be cached.
  • jinx_fast_cache_taxonomies: Control the taxonomies which should be cached. By default all taxonomies which are „publicly_queryable“ will be cached.
  • jinx_fast_cache_terms: Filter the terms which should be cached.
  • jinx_fast_cache_output: Use this to modify the HTML content written to your cache file.
  • jinx_fast_cache_minify: Return true (default) or false if you want the output to be minified.
  • jinx_fast_cache_flush: Control which URLs should be flushed. This may be used to flush related URLs eg. your front page.
  • jinx_fast_cache_warm: Control which URLs should be warmed. This may be used to warm related URLs eg. your front page.
  • jinx_fast_cache_interval: Change the interval of the cron task (default 60).
  • jinx_fast_cache_queue_size: Change the number of URLs which should be handled durring a cron task (default 10). When setting it to <= 0, all URLs will be handled. This may cause a huge load when you have a lot of URLs.

Injections

Jinx Fast-Cache also provides the feature to inject dynamic content parts. If you eg. want to print the users name on the page, you may inject it via ajax.

Note that the first parameter is the placeholder content. This will prevent any problems when calling the action without the plugin beeing active. You may load the template normally or print a note like „loading …“.

Inject a template:

do_action('jinx_fast_cache_inject_template', null, 'user');

This has the same result as:

do_action('jinx_fast_cache_inject', null, 'get_template_part', ['user']);

You may call every public function of PHP, your theme or plugin:

do_action('jinx_fast_cache_inject', null, 'date', ['Y']);
do_action('jinx_fast_cache_inject', null, 'my_function', ['param1', 'param2']);
do_action('jinx_fast_cache_inject', null, 'namespace\MyClass::myMethod', ['param1', 'param2']);
do_action('jinx_fast_cache_inject', null, ['namespace\MyClass', 'myMethod'], ['param1', 'param2']);<h3>Roadmap</h3>

– [x] Release it
– [x] Add HTML minification for output
– [x] Allow injection of dynamic rendered templates using ajax requests
– [x] Add taxonomies
– [x] Provide scheduled tasks
– [x] Add admin columns for cache status
– [ ] Provide exclude option for posts and terms in backend
– [x] Add multisite support
– [ ] Provide cache timeout
– [ ] Provide admin panel to change options

Installation

  1. Unzip the downloaded package
  2. Upload jinx-fast-cache to the /wp-content/plugins/ directory
  3. Activate the plugin through the ‚Plugins‘ menu in WordPress

Rezensionen

There are no reviews for this plugin.

Mitwirkende & Entwickler

„Jinx Fast-Cache“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:

Mitwirkende

Übersetze „Jinx Fast-Cache“ in deine Sprache.

Interessiert an der Entwicklung?

Durchstöbere den Code, sieh dir das SVN Repository an oder abonniere das Entwicklungsprotokoll per RSS.