Cache-Control
-
Hi,
Does ninjafirewall affect cache-control?
Because my caching rules in htaccess doesn’t work
-
Hi,
Normally, it doesn’t because your .htaccess is processed before PHP (and NinjaFirewall).
Can you post your rules here, and also give more details about how did you notice they don’t work.Hi,
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault “access plus 1 day”
ExpiresByType image/jpg “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType text/css “access plus 7 days”
ExpiresByType application/pdf “access plus 7 days”
ExpiresByType text/javascript “access plus 7 days”
ExpiresByType application/x-shockwave-flash “access plus 7 days”
ExpiresByType image/x-icon “access plus 1 month”
ExpiresByType x-font/woff “access plus 1 month”
</IfModule>
## EXPIRES HEADER CACHING ##Upgrade to the new NinjaFirewall version 3.6.7 which was released today and try your test again. There was a small issue in the 3.6.6 which may be the reason why you get those results.
Hi,
The problem still exists 🙁
Is Ninjafirewall does’t work with HTTP / HTML cache?
It works for me. This is what I get with and without NF when I use your rules:
$ curl -I http://192.168.43.101/ HTTP/1.1 200 OK Date: Thu, 02 Aug 2018 17:56:55 GMT Server: Apache/2.4.25 (Debian) Link: <http://192.168.43.101/wp-json/>; rel="https://api.w.org/" X-XSS-Protection: 1; mode=block Cache-Control: max-age=2592000 Expires: Sat, 01 Sep 2018 17:56:55 GMT Content-Type: text/html; charset=UTF-8Make sure to use a command line tool like
curlor, if you test from a browser, either delete your cookies or restart your browser because as a WordPress admin, you still have a PHP session cookie (which was used when your were logged in) and that will fail the test.I see.
One more question.
Is it possible to disable PHP session cookie, because if using Cloudflare cache everything rule, Cloudflare will cache login users pages and login cookies.It is not possible to disable it because it is used to whitelist the admin as well as the access to the login page. But Cloudflare should not cache your admin dashboard, the login page and cookies, because that would be a security risk.
The topic ‘Cache-Control’ is closed to new replies.