0

Scenario: - My site pages and most pages usually loads around 3s to 5s. - I have a lot of posts on my site and new posts are added every 12 hours. I did not use any on site caching plugin to avoid large diskspace usage for cache files. - I am using cloudflare cache with expiry set to 8hours so that my front page, categories and archive pages can be updated with fresh contents accordingly.

Problem: - I wanted to improve my google page speed score and tried to run plugins like autoptimize which can auto minify and defer render blocking of css and js. - These plugins improved my page rank score tremendously for cached pages. - However these plguins actually made my site slower as they add 5 to 10 seconds to first load of uncached pages for them to do their minifying and cache writing.(My cache expire every 8 hours)

Question: Under my scenario, is there a way that I able to retain/improve my usual site speed and satisfy pagespeed minify and script defer requirement?

4
  • You could build a cache warmer and let it run on crons to cURL all URLs in your sitemap or something like that.
    – leymannx
    May 26, 2019 at 22:40
  • 1
    You can minify and defer by hand, plugins such as autoptimise aren't needed and are more like a brute force hammer approach ( they also cripple your TTFB times etc ), but keep in mind that minifying javascript and CSS isn't a WP question, and would be better asked on stackoverflow, and that sometimes deferring a script doesn't improve performance ( e.g. if your site requires jQuery to display things, deferring it may not be so useful ). Page speed is a guide, not a law, if you're doing this for SEO purposes, it goes off of the loading times, not the things in the pagespeed tests
    – Tom J Nowell
    May 26, 2019 at 22:41
  • Thanks for your suggestion Tom J Nowell. I have followed your advice and manually minify .js and .css files before hand, instead of using a plugin to do it for me everytime the page loads. Like you said do not used a brute force hammer.
    – Calvin
    May 27, 2019 at 4:58
  • Additional information request. Post on pastebin.com and share the links. RAM size of your MySQL Host server A) complete (not edited) my.cnf or my.ini Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; AND Optional very helpful information, if available includes - htop OR top OR mytop for most active apps, ulimit -a for a linux/unix list of limits, iostat -xm 5 3 for IOPS by device and core/cpu count, for server workload tuning analysis to reduce your typical 3-5s loads. May 30, 2019 at 13:28

1 Answer 1

1

In the end, I used speed booster plugin to defer javascript and inline CSS. For minifying, I manually minify the .js script and .css files before hand. This helped to improve my pagespeed score without going through first load issue.

Like Tom J Nowell suggested, do not use brute force hammer approach by using plugins like autoptimize which actually made the task more complex.

1
  • You can accept your own answer with a check mark as solution. Jul 10, 2019 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.