Skip to content

Alligo "RFC 7234" extension for Joomla CMS (aka Varnish-Cache for Joomla! plugin)

License

Notifications You must be signed in to change notification settings

alligo/joomla-varnish-cache-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alligo "RFC 7234" for Joomla CMS (aka Varnish-Cache plugin for Joomla!)

A Joomla CMS plugin for high traffic (or SEO concerned) websites compatible with RFC 7234 optimized for fault-tolerant and very fast responses (from > 1s to < 0.05s) while requiring 4-10 times cheaper hardware.



Quickstart

Since the idea of making the site faster is more than install a plugin, this section give a quickstart on the topic.

1. Website configuration

Joomla plugin installation (this plugin)

  1. Download a version
    1. For example, the latest version from https://github.com/alligo/joomla_plg_system_alligovarnish/archive/refs/heads/master.zip.
  2. Upload to your Joomla test site, like any other Joomla plugin.
    1. It can be a test version of the real site. A localhost installation could be used for basic testing, but full implementation with Varnish would require that even your test site is served by Varnish.
  3. Enable the plugin and check potential incompatibilities with other plugins.
    1. The Joomla plugin "System - Cache" (on disk: plugins/system/cache) while is recommended to be used for big sites without Varnish-Cache and a a lot of free disk space, may be not incompatible with this plugin, but may not increase performance. Do your tests.
    2. Note: the cache configurations for Joomla on Administrator Panel > System > Cache configurations still worth to NOT disable. They are important for reusable parts of the site (like cache at module level). Reason: while this plugin works as full page cache (at server level, on Varnish or equivalent), the cache done by Joomla for modules is important to keep it enabled, even if for short time! 1. Example: if a slow efficient module (like one that request weather for a city, or currency quotations) is slow (as in 0.3s) and is loaded on all pages of your site, Varnish will be 0.3s faster for each first page it caches.
  4. Customize each functionality of the plugin
    1. This plugin requires configuration and testing based on how you're caching servers operate. This is why it has so many options and is inviable create a generic version of Varnish default.vcl for everyone.

2. Caching server configuration

Since joomla_plg_system_alligovarnish mostly give hints of how content should be cached, it requires some frontend caching server even to maximize use on Browser caching to remove the cookies when the user is not authenticated.

You must select one option.

A. Varnish

The cheapest way to do it yourself (or some expert contracted by you using this plugin) have one or more Varnish servers. Since the community version of Varnish does not offer HTTPS, our recommendation is serve the HTTPS with NGinx.

Visitor -> NGinx (HTTPS) -> Varnish -> YourSite

Protip: at bare minimum, compared to standard Varnish configuration, options remove cookies used by Joomla for non-authenticated users is necessary. Without this, both Varnish (or equivalent) will not cache.

Recommended reading:

B. NGinx (instead of Varnish)

Short answer: yes, it is possible.

Long answer: While it is possible to use NGinx to replace entirely Varnish-Cache (not just to serve the HTTPS layer, a role that NGinx is perfect), the end result would be less than "4-10 times cheaper hardware". Yes, is possible, but not as efficient. One main argument to not recommend this if is viable use Varnish is that the end result will be harder to debug, in special when cache invalidation is necessary.

C. Cloudflare, Fastly, etc (3rd party providers)

The joomla_plg_system_alligovarnish is tested against customized Varnish servers, but since it abstract RFC 7234, and try to be as flexible as possible, it is likely to make easier to use other providers.

Sadly, some, like Cloudflare, will not provide caching for Joomla generated content (the HTML versions, not the images) on the free option like is possible to do with custom Varnish server. **In other words:

(...TODO explain more...)


Specifications

Note: this plugin was mostly tested with Varnish 6.0 (https://varnish-cache.org/docs/6.0/index.html) with some customizations on default.vcl (to not require Varnish Plus) and HTTPS via NGinx. But as it implement part of RFC 7234 is likely to be more flexible, including other caching solutions. Please note that Joomla, like any other CMS, will use cookies even for non-logged users, but workaround strategies for this are also more Generic. Is no feasible to create a Joomla plugin to rewrite such cookies since even client side JavaScript libraries (including Google Analytics) would invalidate this.

Other links to see

License

Public Domain Dedication

The Alligo has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

About

Alligo "RFC 7234" extension for Joomla CMS (aka Varnish-Cache for Joomla! plugin)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published