88

Product support

Visit this product's website for support.

Categories

This page in Russian with all instructions.

OctoberCMS lightning fast static files cache system

Lightning fast cache system that converts your website page to static .html, .xml, .json and other files.

Store your pages as static files and deliver it to your visitors in milliseconds!

Features

  • No additional configuration needed! Easy to use on shared hosting! Install in one click.
  • Smart content type determination by headers or file extension, with ability to be extended.
  • Full Storage service support. You can configure custom cache disk via config.
  • Optional query strings support configurable from backend.
  • Optional excluded paths configurable from backend.
  • Easy extendability by October CMS events.
  • No dependencies, works with October CMS v1.1, v2, v3.
  • Can be used with October CMS AJAX Framework!

Notice

This plugin stores the response of your pages as static files. You should be aware that cached pages are the same to everyone no matter in what state (logged or not) visitor session are. Otherwise, personal information can be seen by every visitor.

Use Quicksilver settings to set excluded paths, so pages with sensitive information will not be cached.


© 2023, Nick Khaetsky at Biz-Mark under the GNU General Public License v2.0.

Requirements

  • PHP 7.4 and above
  • October CMS v1.1 or v2 or v3

Installation

php artisan plugin:install BizMark.Quicksilver

Optional configuration

Quicksilver can be configured additionally so webserver can check for cached pages by itself, completely ignoring application booting.

Apache

  1. Open .htaccess and add the following before Standard routes section

    ##
    ## Serve Cached Page If Available
    ##
    RewriteCond %{REQUEST_URI} ^/?$
    RewriteCond %{DOCUMENT_ROOT}/storage/quicksilver/cache/qs_index_qs.html -f
    RewriteRule .? /storage/quicksilver/cache/qs_index_qs.html [L]
    RewriteCond %{DOCUMENT_ROOT}/storage/quicksilver/cache%{REQUEST_URI}.html -f
    RewriteRule . /storage/quicksilver/cache%{REQUEST_URI}.html [L]
    RewriteCond %{HTTP:X-Requested-With} XMLHttpRequest
    RewriteRule !^index.php index.php [L,NC]
  2. Comment out following line in White listed folders section.

    RewriteRule !^index.php index.php [L,NC]
  3. Be sure that plugin can create/write/read "storage/quicksilver/cache" folder in your storage path.

Nginx

location = / {
    try_files /storage/quicksilver/cache/qs_index_qs.html /index.php?$query_string;
}

location / {
    try_files $uri $uri/ /storage/quicksilver/cache/$uri.html /storage/quicksilver/cache/$uri.json /index.php?$query_string;
}

If you need to send ajax requests to cached url, you should use this construction

location / {
    if ($request_method = POST ) {
        rewrite ^/.*$ /index.php last;
    }

    try_files $uri $uri/ /storage/quicksilver/cache/$uri.html /storage/quicksilver/cache/$uri.json /index.php?$query_string;
}

Ignoring the cached files

Don't forget to put Quicksilver folder in your .gitignore.

/storage/quicksilver

Clearing the cache

php artisan quicksilver:clear

Or to clear specific route

php artisan quicksilver:clear {path}

Events

These events called when request and response are validated, if returned true Quicksilver will continue validation.

  • bizmark.quicksilver.is_request_valid - bool
Event::listen('bizmark.quicksilver.is_request_valid', function(\Illuminate\Http\Request $request) {
    // request is valid, cache.
    return true;

    // request is invalid, don't cache.
    return false;
});
  • bizmark.quicksilver.is_response_valid - bool
Event::listen('bizmark.quicksilver.is_response_valid', function(\Symfony\Component\HttpFoundation\Response; $response) {
    // response is valid, cache.
    return true;

    // response is invalid, don't cache.
    return false;
});

These events called before and after storing cached page, so you can modify contents of it.

  • bizmark.quicksilver.before_store - void

    Event::listen('bizmark.quicksilver.before_store', function(array $fileInformation) {
    // Contents of fileInformation
    // $fileInformation = [
    //     name
    //     extension
    //     directory
    //     mimeType
    //     path
    // ];
    // ...
    });
  • bizmark.quicksilver.after_store - void

    Event::listen('bizmark.quicksilver.after_store', function(array $fileInformation) {
    // Contents of fileInformation
    // $fileInformation = [
    //     name
    //     extension
    //     directory
    //     mimeType
    //     path
    // ];
    // ...
    });

© 2023, Nick Khaetsky at Biz-Mark under the GNU General Public License v2.0.

  • Found the plugin useful on 24 Jun, 2024

    Hi, just wanted to flag that in the latest version the enable_query_strings setting doesn't work because in both AbstractCache.php and StorageCache.php the setting that is used is cache_query_strings (which doesn't exist) rather than enable_query_strings.

  • author

    Replied on 1 Jul, 2024

    Thanks for your review!

    If you want to send us an issue, you can do it via email or public repository. The fix already published, you can update your plugin and settings code will be changed accordingly.

  • Found the plugin useful on 18 Mar, 2024

    Works great!! Really happy with this plugin!

    I noticed that there is no caching of a page when logged in the backend. Is there a way to cache a page when admin is logged in? My own plugin clears the cache when a client adds or edits records, right now he must visit the page with a private browsing window to cache the "new" page again. Is there a way to automate this? Or a way to have the pages cache when when logged in from the backend? I wanted to ask this in the "product support" section, but I can't register because the confirmation mail for a new account is not send..

  • author

    Replied on 21 Mar, 2024

    Thanks for the review!

    The feature of not caching while a backend user is logged in cannot be turned off. But, we might add a switch to turn it off in settings in next updates!

  • Found the plugin not useful on 19 Nov, 2023

    After install in october 3.4 then refresh some pages. But I can not see anything in storage/quicksilver directory (already set 777 for storage/quicksilver).

  • author

    Replied on 20 Nov, 2023

    Hello Nguyen! Sorry to hear that you meet some unexpected work from our plugin. Static cache generates only when the request meets all conditions:

    1. You have to be logged out of admin panel.
    2. Route doesn't start with /combine
    3. Request isn't XHR from frontend framework
    4. Route doesn't meet URL exceptions from settings
    5. Response for request has 200 code from backend

    Hope this helps you.

  • Found the plugin useful on 14 May, 2023

    This is great! Especially suitable for small, less dynamic websites. Keeps the server cool.

  • Found the plugin not useful on 1 Apr, 2023

    Garbage. I installed the CMS base system without adding anything and I've uploaded a free template that has this plugin as dependency. After I did this the website never worked as it should have worked. There were pages without CSS, there were pages with first template, other pages with other one. The links didn't work, the site config didn't work.

  • author

    Replied on 3 Apr, 2023

    Hello Andras! Sorry to hear that you have bad experience with our plugin. Seems like you have a problem with your free template or configuration of your web server, because everything that you mentioned is not the responsibility of Quicksilver. Remember that our plugin just caches responses with 200 code from backend, and stores them in storage. Quicksilver doesn't handle any links, static files or anything but the raw HTML of success response. If you believe that our plugin is a source of your problems, email us on info@biz-mark.ru, and we will be happy to help you with your case!

  • Found the plugin useful on 17 Dec, 2022

    Great Plugin. Thank you for sharing!

  • author

    Replied on 19 Dec, 2022

    Thanks for the review!

  • Found the plugin useful on 5 Dec, 2021

    The plugin is very good! Now I score 98 points in the Google test =)

  • author

    Replied on 5 Dec, 2021

    Thanks for the review! We are happy that your pagespeed rank is so high!

  • Found the plugin useful on 22 Nov, 2021

    This is an excellent plugin.

    For static type sites such as blogs, news etc this will greatly reduce running costs and will ensure there is no collapse under a surge of users (Reddit share etc).

    I have previously implemented the same functionality using the Nginx fast cgi cache but this achieves a similar benefit but with minimal configuration.

    Great job, and thanks!

  • author

    Replied on 23 Nov, 2021

    Thanks for your review! We glad that our plugin helped you in your project!

  • Found the plugin useful on 3 Apr, 2021

    This is really awesome plugin. Simple but do the job in the best way. Once it saved my server from unexpected traffic, before using this plugin load average was over 20 of 6 maximum, and all another apps and sites on this machine works in impropper way. Even caching all data in Radis don't really helped. But when I setup this plugin, all goes fine. Thanks for this plugin!

  • author

    Replied on 3 Apr, 2021

    Thanks for review! We are happy that our plugin helped you with unexpected traffic!

  • Found the plugin useful on 6 Jan, 2020

    OMG! This is very cool! This plugin saved me from torment! Thanks!

    sorry a lot of emotions

  • author

    Replied on 9 Jan, 2020

    We are pleased to know that our plugin helped you! Thank you for using it!

3.2.2

Fixed wrong settings code for caching query strings

Jul 01, 2024

3.2.1

Small styling changes.

Sep 30, 2022

3.2.0

Make default headers configurable.

Sep 29, 2022

3.1.0

Added ReportWidget with convenient path clearer.

May 30, 2022

3.0.3

Add Cache-control header to cached responses.

Apr 27, 2022

3.0.2

Added query params check in has() method.

Apr 25, 2022

3.0.1

Reintroduced support for PHP >=7.4

Apr 23, 2022

3.0.0

Complete refactoring. Read UPGRADE.md.

Apr 21, 2022

2.1.0

Auto clearing default caches, refactoring

Sep 16, 2021

2.0.0

Added support for exceptions and the ability to disable some pages from the cache

Dec 09, 2020

1.3.0

!!! Query strings filtering for dynamic pages.

Nov 21, 2019

1.2.2

Minor fixes

Nov 21, 2019

1.2.1

Fixing typo in russian localization

Nov 20, 2019

1.2.0

!!! New ReportWidget for dashboard that allows quiclky purge pages cache and october cache.

Nov 20, 2019

1.1.6

Fixing backend opening error

Oct 09, 2019

1.1.5

!!! Ajax requests now work properly on cached pages. Place new code in your htaccess like in documentation

Aug 19, 2019

1.1.1

Note about AJAX on cached pages in README

Aug 19, 2019

1.1.0

!!! Updated configuration section in README. To actually use power of this plugin please configure it.

Jul 12, 2019

1.0.1

Removed routes.php file

Jul 12, 2019

1.0.0

First version of Quicksilver

Jul 02, 2019

Upgrading To 3.0

  1. Cache folder changed from /storage/page-cache to /storage/quicksilver/cache
  2. Webserver configuration (.htaccess or nginx) is optional now, and can be removed. Quicksilver has more features without webserver configuration.

Upgrading To 1.3

Open your .htaccess file, and replace old section of "serving cache rules" with new from documentation

If you edited this section, or don't want to replace whole section, you need to add this two lines right after section headline.

RewriteCond %{QUERY_STRING} ^(.)
RewriteRule !^index.php index.php [L,NC]

© 2022, Nick Khaetsky at Biz-Mark under the GNU General Public License v2.0.