Support

Admin Tools

#23691 Suggestion/question for htaccess maker

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 on Saturday, 12 December 2015 17:20 CST

drjjw
Hello,

In htaccess maker, the feature:

Set default expiration time to 1 hour

does indeed speed up websites where it is used. However, it creates problems logging out and in of websites. One often has to refresh the page to reflect the login or logout and this is not apparent users. If one comments out this line but leaves the rest, then all is well:

ExpiresDefault "now plus 1 hour"

Would you consider adding a further option to separate the global 'Default expiration' from the rest of the expiry settings. Otherwise we have to manually comment the htaccess every time you use it.

Jordan

nicholas
Akeeba Staff
Manager
Hello Jordan,

I'm not sure your diagnosis is accurate. Joomla! sends cache busting HTTP headers in the back-end login page. Here's the response from accessing the administrator/index.php URL on my dev site as recorded by Charles Proxy (minus the HTML part of course):
HTTP/1.1 200 OK
Date: Wed, 11 Nov 2015 14:39:39 GMT
Server: Apache
X-Powered-By: PHP/5.6.10
X-Frame-Options: SAMEORIGIN
Expires: Mon, 1 Jan 2001 00:00:00 GMT
Last-Modified: Wed, 11 Nov 2015 14:39:39 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Keep-Alive: timeout=5, max=96
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

The Expires, Cache-Control and Pragma headers tell browsers and caching proxies to NOT cache the page.

The other back-end pages also send similar headers:
HTTP/1.1 200 OK
Date: Wed, 11 Nov 2015 14:40:22 GMT
Server: Apache
X-Powered-By: PHP/5.6.10
Expires: Mon, 1 Jan 2001 00:00:00 GMT
Last-Modified: Wed, 11 Nov 2015 14:40:23 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8


Please note that these headers are sent by Joomla!, not the .htaccess file.

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!

drjjw
Hi Nick,

I have only experienced this issue with frontend pages. And it has been highly reproducible for me, when using a a combination of that expiry setting in htaccess, JotCache and Global cache on. It has not been a problem on the admin side. When I comment out the default setting only, I still get proper expiry headers set for static resources (images, js, css) but don't get the login/logout issue.

Jordan

nicholas
Akeeba Staff
Manager
I checked the front-end pages with and without caching enabled in Global Configuration. They still return headers to bust caching, therefore overriding the default cache handling in .htaccess. See:
HTTP/1.1 200 OK
Date: Thu, 12 Nov 2015 07:46:51 GMT
Server: Apache
X-Powered-By: PHP/5.6.10
Expires: Mon, 1 Jan 2001 00:00:00 GMT
Last-Modified: Thu, 12 Nov 2015 07:46:51 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8


When you enable the "System - Page Cache" plugin AND its "Use browser caching" option then you do indeed get no Expires and Last-Modified headers which does tell the browser that it should cache this page. However, even if you disable .htaccess Maker's expiration time feature the page will still be cached by an amount of time specified by the browser. That is to say, the default expiration time does not seem to have any effect whatsoever to the Expires headers.

You may want to try adding
ExpiresByType text/html "now plus 1 second"

in the "Custom .htaccess rules at the bottom of the file" area and regenerate your .htaccess. This will effectively instruct the browsers to NOT cache your HTML pages which completely counters the purpose of setting the global cache setting but is equivalent to removing the default caching line.

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!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!