I’ve tried various methods and so far have the following in .htaccess:
ExpiresByType text/css "access plus 1 month"
ExpiresDefault "access plus 1 month"
# 1 month exp
Header unset Set-Cookie
Header set Cache-Control "max-age=2592000"
Header unset ETag
And the PHP file that serves the JS content has the following headers:
header("Cache-control: max-age=2592000, must-revalidate");
When I go to do a speed-test it still shows “specify a cache validator for js.php”
Is what I’m doing even possible or am I just missing something?
I’ve experienced a weird issue on a site using WordPress + Woocommerce recenty. The site uses W3 Total Cache for page cache and browser cache and although i’ve set the woocommerce_cart_items cookie in the rejected list for page cache, the front page is beeing cached .
As a result i’ve issues with the cart ,empty on front page as is served as static, in other shop pages are regenerated and everything is fine.
To my understanding, pages are supposed to be cached if the cookie woocommerce_cart_items is missing ( so we have a guest customer browsing ), and after a product is added in the cart, woocommerce created a session and the cookie is stored so next time the frontpage is called it’s beeing regenerated and not served as static, is that right?
Is there a way to ensure this functionality?
Is this affected depending on the caching option selected (disk, apcu …)? if i decide to use redis for page cache , which is the best way to exclude such things from beeing cached?
I’m quite new to PHP and have received some Symfony2 project to maintain. Now I’ve found out that when I update
foo.html.twig, that page will not change until I perform the command
console c:c -e prod. Until then the shown page will be
foo.html_.twig (hence the underscore).
The problem is that I’ve changed a controller, let’s say
BarController.php, but the new added value in that controller does not work in the .twig file, I think because the
BarController_.php did not get updated with the clear cache command. What did I do wrong here?