Support

Admin Tools

#32732 Admin Tools WAF, OWasp, Cache settings and NGINX

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by jordand714 on Saturday, 28 March 2020 08:08 CDT

jordand714
I just moved all my sites to a faster server in a VPS environment (Apache, PHP). The hosting company recommended installing NGINX for its caching function and OWASP rules for security.

I would like your opinion to help me optimize my settings with Admin Tools Professional...

1. Is installing OWASP a good decision? I initially discovered 3 rules that had to be removed because they broke the site, but now things seem to be stable. More specifically is there any redundancy or any settings that should be avoided in the Admin Tools WAF configuration? Are there any settings in .htaccess that should be adjusted?

2. Presently I have the Joomla cache set to ON-Conservative. I also have the cache cleaning option in Admin Tools plugin set to on. In my CPanel the (NGINX) cache manager is set to refresh about every 4 hours. What is the recommended way to configure Joomla and Admin Tools when NGINX is installed? Turn cache off and let all the caching be handled by the CPanel cache manager? Or is NGINX maybe not a good choice for Joomla sites?

Thanks for your kind help.
Doug

nicholas
Akeeba Staff
Manager
1. Yes, it's a good idea. These rules are generic, though. You will need to monitor your site and disable any rules which get in the way of your site's operation. There's no special configuration you need to do in Admin Tools.

2. These are different caches. Joomla's cache is about not having to go through the web application for rendering the HTML page. NginX cache is about not hitting the application and the disk at all when a resource is already in memory and hasn't expired.

Joomla's cache is a good idea as long as your site doesn't have a lot of per-user pages. For example, our site's traffic is primarily a support ticket system and the per-user pages (downloads, my subscriptions etc). It makes no sense for us using the Joomla cache since every user sees a different page anyway.

NginX cache is a good thing to enable. When to clean it? That largely depends on your site. If your site's pages and static content are unlikely to change often you could even increase that time to 8 or even 12 hours. You do have to clean it every time you update something on your site, though, be it Joomla or its extensions. There's no one-size-fits-all approach. We do use NginX as a reverse proxy on our site because of its superior HTTP/2 support and its very efficient static file management. We also use version query strings in all of our static content (JS, CSS) so we could leave the default caching behavior enabled without breaking anything on our site.

As for cPanel's cache manager... that's not a part of cPanel. Maybe it's something specific to your host. I know of some hosts which use Varnish or another caching proxy like that. Since I don't know what it is I can't tell you what to do. But I can tell you that if your site's frontend is not overwhelmingly static you will NOT benefit from it. If anything, it'd get in your way. Our host offered such a thing in the past and we had explicitly disabled it.

In so many words, the answer to each and every one of your questions is "it depends". The best way to do it is try different options and see what are the effects to your site's performance and operation.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jordand714
Thanks for your advice.

My host tells me the CPanel Cache Manager is in fact a user friendly interface to NGINX which enables me to turn cache off (for development and testing,) add pages to exclude from the cache, flush the cache when needed and adjust the cache lifetime.

Which brought another thought to mind...

Given that I will be using the Joomla Cache which is periodically flushed by the Admin Tools plugin along with NGINX which is set to flush every four hours now, what should the relative timing be? Should the Joomla cache be set longer, shorter or the same... does it matter?

Warm regards,
Doug

nicholas
Akeeba Staff
Manager
Set the Joomla caching lower than the NginX cache timeout. Joomla uses that cache timeout setting to set the HTTP headers which tell NginX how long to cache a page (and never more than NginX's cache clear timeout). Therefore, setting a higher value in Joomla is useless.

That said, I do NOT recommend setting a very high cache time in Joomla. This will lead to stale content being delivered. The ideal setting is between 5 and 30 minutes. Enough to reduce the load on your server for very frequently visited pages, not so much as to cause stale content issues. The default of 15 minutes is a good start.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jordand714
Thank you. I will try your suggestions.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!