Guys, could do with a bit of help.
My Newsmag 1.6 site (I did not upgrade to 1.7 due to the reported increase in load times) runs on a LEMP installation with Nginx + PHP-FPM + APC + Varnish running nicely.
On top of this I use WP-Rocket to cache, minify, concatenate, and lazy load.
In so far that I can tell, everything works more or less.
I want to take it to the next level.
I have already used PUTTY and optimized nginx.conf, nginx’s pool.d, varnish’s default.vcl, php.ini, php-fpm etc.
I have already put in the strings to leverage browser caching both in .htaccess, nginx, varnish etc.
Strangely, some files are still not displaying cache expiry dates.



Any ideas on why certain .css and .js files aren’t caching?
Thanks for all the help.
(I will give the tagdiv dev’s my URL if they wish for it)
I realise I cannot cache external resources.
What I mean is that before I put the settings in nginx/varnish etc. I have about 30 internal resources (.js, .css etc), however, now, I seem to just be left with these few resources, and for some reason they aren’t displaying browser cache expiry headers.
I have signed up with cloudflare, currently awaiting DNS resolution cache all my static assets.
Still does not explain why only some of the resources are getting cache expiry headers.
btw…
if you’re *not* using my example cache expiration file for htaccess … note most of the other versions forget to include expirations for font files (!).
So, be sure to look at that as one possible element for the font expiration headers (e.g., .woff).
As to the .js issue … that is odd … might be a setting on the main server for default expiration times, or some interaction with varnish cache time.
You likely already looked at my version of htaccess, but it’s here
https://forum.tagdiv.com/topic/tutorial-chriss-custom-optimizations-for-functions-php-etc/
Hey Chris,
Here are my files.
I hope you guys can spot the error in the code because its driving me insane!
P.S. I have anonymised the site.com -> domain.com
-
This reply was modified 10 years by
Andrei L..
Right … so I can’t write your code for you…
if you look at *MY* example code, you can see I’ve added both “type” handlers to definte .js and font files and then added expirations for the font formats.
Try copying the code for fonts and js I have which you’re missing.
Chris
WP Optimize By xTraffic is super better than wp rocket and its free work 150% with newsmag 🙂 https://wordpress.org/plugins/wp-optimize-by-xtraffic/
COMMENT:
Always best to optimize yourself with built-in features of server, wordpress, htaccess, wp-config, where possible vs using a plugin which may or may not be supported, conflict with other plugins, etc. We don’t use WP-Rocket or WP Optimize, but obviously anybody would need to A/B test their setup from backups and probably not on a production environment.
Hi Chris,
I spotted and added the add type JS and fonts as per your recommendation. Thanks for that.
Repeat speed tests have improved results and decreased load times.
However, still displaying JS & font errors.

Any ideas on how I can improve this further?
Strangely, I am not employing a CDN (yet), but YSlow scored me full marks for that….
Hi
luckily there are no more font caching errors in that report.
In theory my code for functions.php from my optimization page should help with the removing “?” stuff, but not always.
For those other items, check the actual folders to see if they have custom htaccess files for short TTL windows which in some cases are needed so that the theme can actually see changes.
Double check the .js caching setting in your htacess for syntax.
Hi Chris,
Thanks for all the help.
I have managed to remove a few more errors on the site.
Issues:
1. wp-rocket is not setting browser cache expiration for the .css and .js cached/minified files.
Is there a way to force Varnish to set browser cache expiry anything within the /wp-content/cache/min/ folder?
2. Understandably, I cannot set the properties of external resources (googleapis jquery.min). I should however be able to defer parsing of javascript for both internal and external resources. I have already added jquery.min to the tdspeedbooster move to footer area, but it still seems to be parsing during initial load. I surmise that this is what is causing the delay in page load (2.59s)


3. Also, is it possible to defer javascript for the /wp-content/cache/min folder? How do I do this?
Thanks for all the help!
