WordPress.org

Forums

W3 Total Cache
Still having load time issues (28 posts)

  1. Dennis8
    Member
    Posted 4 years ago #

    Hello,
    I've noticed lately that my site seems to be having load delays despite using the plugin with enhanced disk caching, minify and database caching turned on. Especially my homepage loads pretty slow sometimes. According to web page speed report I have issues with css, javascript, images, etc. Here's a typical report about one of my pages:
    -------------------->
    * TOTAL_HTML - Congratulations, the total number of HTML files on this page (including the main HTML file) is 1 which most browsers can multithread. Minimizing HTTP requests is key for web site optimization.

    * TOTAL_OBJECTS - Warning! The total number of objects on this page is 52 which by their number will dominate web page delay. Consider reducing this to a more reasonable number. Above 20 objects per page the overhead from dealing with the actual objects (description time and wait time) accounts for more than 80% of whole page latency. See Figure II-3: Relative distribution of latency components showing that object overhead dominates web page latency in Website Optimization Secrets for more details on how object overhead dominates web page latency. Combine, refine, and optimize your external objects. Replace graphic rollovers with CSS rollovers to speed display and minimize HTTP requests. Consider using CSS sprites to help consolidate decorative images. Using CSS techniques such as colored backgrounds, borders, or spacing instead of graphic techniques can reduce HTTP requests. Replace graphic text headers with CSS text headers to further reduce HTTP requests. Finally, consider optimizing parallel downloads by using different hostnames or a CDN to reduce object overhead.

    * TOTAL_IMAGES - Warning! The total number of images on this page is 39 , consider reducing this to a more reasonable number. Recommend combining, replacing, and optimizing your graphics. Replace graphic rollover menus with CSS rollover menus to speed display and minimize HTTP requests. Consider using CSS sprites to help consolidate decorative images. Use CSS techniques such as colored backgrounds, borders, or spacing instead of graphic techniques to reduce HTTP requests. Replace graphic text headers with CSS text headers to further reduce HTTP requests. Finally, consider optimizing parallel downloads by using different hostnames to reduce object overhead.

    * TOTAL_CSS - Warning! The total number of external CSS files on this page is 6 , consider reducing this to one or two external files. Combine, refine, and optimize your external CSS files. Ideally you should have one (or even embed CSS for high-traffic pages) on your pages. You can optimize CSS files using shorthand properties, grouping, and then minify and GZIP compress them to reduce their footprint. Remember to place CSS files in the HEAD and JavaScript files at the end of the BODY to enable progressive display.

    * TOTAL_SIZE - Warning! The total size of this page is 466139 bytes, which will load in 103.30 seconds on a 56Kbps modem. Consider reducing total page size to less than 100K to achieve sub 20 second response times on 56K connections. Pages over 100K exceed most attention thresholds at 56Kbps, even with feedback. Consider optimizing your site with Website Optimization Secrets, Speed Up Your Site or contacting us about our optimization services.

    * TOTAL_SCRIPT - Warning! The total number of external script files on this page is 6 , consider reducing this to a more reasonable number. Combine, refactor, and minify to optimize your JavaScript files. Ideally you should have one (or even embed scripts for high-traffic pages) on your pages. Consider suturing JavaScript files together at the server to minimize HTTP requests. Placing external JavaScript files at the bottom of your BODY, and CSS files in the HEAD enables progressive display in XHTML web pages.

    * HTML_SIZE - Congratulations, the total size of this HTML file is 15541 bytes, which less than 50K. Assuming that you specify the HEIGHT and WIDTH of your images, this size allows your HTML to display content in under 10 seconds, the average time users are willing to wait for a page to display without feedback.

    * IMAGES_SIZE - Warning! The total size of your images is 340842 bytes, which is over 100K. Consider switch graphic formats to achive smaller file sizes (from JPEG to PNG for example). Finally, substitute CSS techniques for graphics techniques to create colored borders, backgrounds, and spacing.

    * SCRIPT_SIZE - Warning! The total size of external your scripts is 90544 bytes, which is over 20K. Consider optimizing your JavaScript for size, combining them, and using HTTP compression where appropriate for any scripts placed in the HEAD of your documents. You can substitute CSS menus for JavaScript-based menus to minimize or even eliminate the use of JavaScript.

    * CSS_SIZE - Caution. The total size of your external CSS is 19212 bytes, which is above 8K and less than 20K. For external files, ideally keep them less than 1160 bytes to fit within one higher-speed TCP-IP packet (or an approximate multiple thereof). Consider optimizing your CSS and eliminating features to reduce this to a more reasonable size.

    * MULTIM_SIZE - Congratulations, the total size of all your external multimedia files is 0 bytes, which is less than 10K.
    ---------------------

    What especially troubles me that it tells me to minify and compress - I thought that the minify option in w3 already takes care of that? Does that mean I can and should compress/minify even further? Do you have any advice how I can do that? Maybe gzip compression? Are there any plugins for compression that are compatible with w3?

    Also, how come I get this report even the second and third time of analyzing the same page? I thought w3 cache should do its magic at least the second time the page loads.

    I really want to optimize my site so I greatly value anyones input. Thanks!

    p.s: My images need to remain self-hosted.

  2. It's really hard to provide a useful answer without a link. Also I believe the test you are using dumps its cache after every run. Try this test: http://www.webpagetest.org/ and post a link to your results.

  3. Dennis8
    Member
    Posted 4 years ago #

    Ooops, youre right. The page that Im using as an example is:
    http://www.usbmemorysticks.net/lacie-key-flash-drives

    Here's the result from the link you gave me:
    http://www.webpagetest.org/result/100821_3BK6/

    Looks like this tells me as well that minify and gzip isnt working very well. How can that be when I have most of the "best" options set in the minify and cashing tab of W3? Also, what is this "Cache static"?
    Thanks a lot!

  4. efikim
    Member
    Posted 4 years ago #

    from the source of your page it looks like you haven't done everything needed to get the CSS and JavaScript minified and combined.

    You need to enable the minification on the first tab for W3TC, and also to select the files you want minified and combined in the minify tab, and remember to 'export' the final settings you've chosen (I can't remember what the phrase actually used in the button to commit your changes to the site was - I got so confused as to what I had or hadn't fully enabled that I disabled the two phase approach). There's a link for a 'help' wizard near the beginning of the page which gives you a list of the files you might want include, and their most appropriate page types.

    similarly for browser caching there are things to set on the browser caching page as well as on the first page.

    I hope that makes sense!

  5. @Dennis8 Your site actually loads pretty fast for me (1.743s) but there are some settings you need to fix.

    Cache Settings: Turn off database caching and just use page caching with disk enhanced and minify with disk(your on a shared hosting and db caching with disk can slow your site down)

    Gzip: Your host (HostGator) has mod_deflate turned off on its shared servers so nothing you can do

    Minify settings: Use the help wizard and combine and minify your css and js and make sure you set js to embed before </body>

    Browser Cache settings: for css, js, and media files set expires headers lifetime to at least 3 months (7776000s) and for cache control policy use: cache with max-age

    Get the yslow plugin for Firebug and test everything yourself to make sure it's working.

    Also make sure your logged out of your site when evaluating performance because that is how your visitors will be viewing your site.

  6. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    Great support guys. @Dennis8 you can try to enable HTTP compression for minified files on the browser cache settings file and see if it works out.

  7. Dennis8
    Member
    Posted 4 years ago #

    Thanks so much for the support guys! I'm not sure if I fully understand where exactly I should put these recommendations into action so please allow me to paste in my W3 settings I currently have. Please tell me where I should change something, especially regarding the time/interval settings.

    General settings:
    Everything enabled except CDN. Page caching is enhanced disk. Minify is disk. DB caching is disk.
    *** I'm only able to use disk because the other options (Dedicated/Virtual Server, Multiple server) don't seem to be available to me. However, I am on a level 3 VPS plan with hostgator.

    Page cache settings:
    Enabled: Don't cache pages for logged in users
    Enabled: Cache the home page
    Enabled: Cache RSS / Atom feeds (site, categories, tags, comments).
    HTTP compression: Gzip and deflate.
    Maximum lifetime of cache objects: 6600 sec.
    Garbage collection interval: 6600 sec.
    Rest is default.

    Minify Settings:
    Enabled: Rewrite URL structure.
    Enabled: Automatically upload modified files.
    HTTP compression: Gzip and deflate.
    HTML minify settings: Enabled + Don't minify HTML for logged in administrators
    JS minify settings: Enabled
    JS file management: Default
    CSS minify settings: Enabled
    CSS file management: Default
    Maximum lifetime of cache objects: 86400 sec
    Update external files every: 86400 sec
    Garbage collection interval: 86400 sec

    Database Caching Settings:
    Enabled: Don't cache queries for logged in users
    Maximum lifetime of cache objects: 180 sec
    Garbage collection interval: 3600
    Ignored query stems: gdsr_

    Again, I'm on a VPS level 3 with hostgator so I'm a bit mystified why c3mdigital says I'm on a shared server? How can you tell? Are their VPS plans actually on shared servers? (Well, I guess thats the whole point of VPS, huh...) So does that mean some settings just dont go into effect even though I have them enabled? (db disk caching, deflate)

    Also, I notice when Im logged in as an admin and browse around my site or actually edit things in WordPress the site often loads pretty slow. Sometimes forever, like its "hanging". I had this even before I had any W3 installed. Is there anything I can do about that? I know I had contacted hostgator about that a few times and they changed some settings for me (increase of process limit and server memory) but it didnt seem to do much. Maybe I should contact them again about the deflate option.

    Once again thanks, I really appreciate it!

  8. efikim
    Member
    Posted 4 years ago #

    minify still seems not to be working well from looking at your source and the webpagetest.org output
    From both its clear that the js and css files have not been combined - given the number of such files that you have, getting this right should give significant benefits.
    What do you mean by 'JS file management: Default' and 'CSS file management: Default'? The initial state for both these is that no files are combined, and you need to combine the files into groups for each page type; there's a help wizard that will indicate for you which files appear to belong in each group for your template. (and gets it right for me! :) )
    The button for 'help' is near the top of the minify page.

    (I don't know about db or object caching - I haven't bothered to try either of these as I'm using shared hosting)

  9. Dennis8
    Member
    Posted 4 years ago #

    Ok, an update. I just opened a ticket with hostgator and they denied that Im on a shared server, like I said. Im on a VPS.

    However, they did confirm that gzip is turned off (and gzip test tool states so too) but they offered me to recompile the Apache webserver for my VPS to enable it. From what I understand the benefits of using gzip are quite dramatic so I guess I should let them do that, huh? He said though it would take a couple of hours to recompile so it would need to be done during low traffic hours.

    They also confirmed that I should turn off database caching as a VPS Level 3 does not have enough RAM memory to really make effective use of that. Im wondering though if that memory couldn't be increased? What would be a necessary size?

    Btw, I was till on version 0.8.5.2 so I upgraded to the latest and thus was able to enable these recommendations and some more enhancements (after reading the FAQ). I still have a few questions after ploughing though that FAQ but will post these later.

  10. Dennis8
    Member
    Posted 4 years ago #

    As I'm still familiarizing myself with the new version Im trying to figure out what the best minify settings from the help button are. It detects 7 javascripts and 5 CSS on my site.

    On the js, it sets some of them as "all templates" and some of them as "single". One (addthis widget) as "index". Is that ok? And should I embed all of these before </body>, as non-blocking? And if I do that do I also still need to enable "Combine only before </body>" in the general minify JS settings?

    As for the CSS, they are all detected for "all templates". Im not sure if I should minify my WordBay CSS because as you may know that plugin pulls and displays current Ebay listings. Could minification cause any problems here?

    Sorry, but I feel like this is all a bit over my head...but I would really like to learn and understand. Thank you for your help and time!

  11. efikim
    Member
    Posted 4 years ago #

    Its much easier to set up the minify stuff on 0.9.x than the 0.8.5.x series, and it can make a big difference in performance. (It was for this potential that I switched over to W3TC.)
    I'd say yes to getting gzip enabled, but have no experience of VPS systems - not currently needed for my small blogs!

    For configuring JavaScript, I just include them all before </head>. Technically some might be able to be put in the footer, but that requires knowledge of exactly what they do, and (in my opinion) little gain unless all can be moved there, or you have lots of large JS files. Use 'combine only' only if things don't work without it! (Its a compromise for poorly written js.)
    I don't know about WordBay, sorry.

  12. Dennis8
    Member
    Posted 4 years ago #

    So efkim says to embed them before </head> whereas c3mdigital says before </body>. What is really better?

  13. efikim
    Member
    Posted 4 years ago #

    </head> is safe!, </body> is better if they can be safely deferred until then. I don't know which can be safely left til the end of the page and which can't, and can't be bothered to try to test! Probably most can be left, so for optimal performance c3mdigital is probably right!
    I just go for the 'easy' wins!

  14. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    So @Dennis8 are you fully optimized now?

  15. Dennis8
    Member
    Posted 4 years ago #

    Yes and no. Hostgator turned on mod_deflate this morning for my VPS though it still says "gzip not detected" when I do the compatibility check in W3. I will do more testing about that later.

    I still need help with the settings regarding what templates to choose for the CSS and JS detected. Does W3 automatically give the right one to choose? (See my third last post or 5th from top) Thank you!

  16. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    If you use the help wizard it will discover the files for you and you can prune the settings.

  17. Dennis8
    Member
    Posted 4 years ago #

    I know that but I dont understand the template settings the help wizard preselects. For instance, it lists the addthis widget twice, one for "index" and one for "single". Should it be just one for "all templates"?

    Anyhow, I went ahead with all the preselected template settings and chose non-blocking "embed before body" for each one. And what do you know? When my website loads the header image is now missing! And when I go back into the minify help wizard it shows ll the urls red and give me three time the error message "Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/valor88/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php on line 4180"
    Upon this I tried "embed in head" instead but that didnt change anything. Whats going on? Needless to say Ive disabled minification for now.

    On a good note, gzip is working like a charm now. I tested the page I have linked earlier in this thread with the gzip tool and it says:
    Web page compressed? Yes
    Compression type? gzip
    Size, Markup (bytes) 110,276
    Size, Compressed (bytes) 15,011
    Compression % 86.4

    Sweet. :) Now to get minify to work.

  18. Again, I'm on a VPS level 3 with hostgator so I'm a bit mystified why c3mdigital says I'm on a shared server? How can you tell? Are their VPS plans actually on shared servers? (Well, I guess thats the whole point of VPS, huh...) So does that mean some settings just dont go into effect even though I have them enabled? (db disk caching, deflate)

    @Dennis8 I didn't realize you were on a VPS. I just ran a whois on your domain and the IP address came up as The Planet which is where HostGator houses their servers. The mod_deflate issues comes up a lot regarding HostGator's shared hosting because they have it turned off so I wrongly assumed this was your issue with Gzip.

    I am happy to hear you have the compression working. The minify settings can be confusing especially if you are using a lot of plugins that call jquery and include their on js. The problems can sometimes stem from plugins not using the correct enqueue script methods of calling js or by not using the no-conflict jquery.

    My suggestion would be to turn on the minify and enable it for CSS, html, inline js, and line break removal.

    My other suggestion is to test and see if your getting any gains by using object cache via disk or install APC on your VPS for object cache.

    HostGator will install APC for you for $30 or you can install yourself following these instructions which are slightly modified from the APC installation instructions in the plugin for a CPanel VPS

  19. Dennis8
    Member
    Posted 4 years ago #

    Ok but i dont understand how these things have to do with my header image? Why would my header image disappear?

    What does it have to do with this error message I got in the minify help settings? Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/valor88/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php on line 4180

    What could the problematic JS be? Minfiy correctly detects the following plugins:
    Collapsing Categories, NextGen Gallery, Addthis and Commentluv.
    It also shows two JS items I am not able to associate:
    wp-includes/js/hoverIntent.js?ver=2.9.1 +
    wp-includes/js/jquery/jquery.js?ver=1.3.2

    It had all turned turned on with the pre-chosen template settings and no matter if set to embed in head or embed before body, it caused the above error message plus the header image disappearing from my blog.

    Or could the CSS be at fault here? I had all those turned on for the exception of WordBay. Meaning:
    NextGen Gallery, style and cl_style.

    I would really appreciate more help. Thanks!

  20. Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/valor88/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php on line 4180

    There was a bug in version 0.9.1.1 with the minify help screen but it didn't effect the front end of the site and still combined the files.

    Upgrade to the latest version that should show as an upgrade in your dashboard.

    wp-includes/js/hoverIntent.js?ver=2.9.1 +
    wp-includes/js/jquery/jquery.js?ver=1.3.2

    Those are included js files that come with WordPress they are being enqueued by either your theme or a plugin. Also those are from WordPress 2.9

    When combining your js files jquery has to be the first one because all the other ones won't work unless it is loaded. If you have any inline js which you do then jquery will have to go before <body> or none of the inline scripts will work.

    Ok but i dont understand how these things have to do with my header image? Why would my header image disappear?

    Your header image shows up fine for me.

  21. Dennis8
    Member
    Posted 4 years ago #

    Thanks for your input, c3m.

    There was a bug in version 0.9.1.1 with the minify help screen but it didn't effect the front end of the site and still combined the files.

    Upgrade to the latest version that should show as an upgrade in your dashboard.

    Ah thanks for pointing that out to me. I upgraded but unfortunately I still get that error when I turn on all the scripts. "Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/valor88/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php on line 4180"
    What exactly is on line 4180? Hmm, the wepagetest.org results look very good now (e.g. 100% JS minify) but I notice that a couple of my plugins don't work anymore like the commentluv or addthis. I have set jquery set to embed before body but it doesnt seem to matter whether I embed the other JS scripts non-blocking in head, blocking in head or the same with body. And whether I turn on the minification setting to "combine only before body" or have that turned off doesnt make a difference either. Sigh...

    Those are included js files that come with WordPress they are being enqueued by either your theme or a plugin. Also those are from WordPress 2.9

    When combining your js files jquery has to be the first one because all the other ones won't work unless it is loaded. If you have any inline js which you do then jquery will have to go before <body> or none of the inline scripts will work.

    Ah, thanks for explaining that to me. This was a great help!

    Your header image shows up fine for me.

    Of course because at the time I had turn any minification off again (just like now). ;-) It looks like when I minify and combine my CSS the header image disappears. There really seems to be some trouble with my CSS because wepagetest.org also tells me then that only 26% of my cookies are working properly. As soon as I turn the CSS settings off the cookies are back to 100%. What is this about? Most of these failed cookies come from images but also plugins JS.

    I guess I'm screwed, because it looks like neither JS or CSS can be successfully minified and combined. At least not for most of my scripts. :(

    Browser Cache settings: for css, js, and media files set expires headers lifetime to at least 3 months (7776000s) and for cache control policy use: cache with max-age

    I have done this. Would it also be wise to use the same headers lifetime and cache policy settings for html?

  22. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    I have done this. Would it also be wise to use the same headers lifetime and cache policy settings for html?

    It's up to you and how you want your site to work or what tests you wish to have your site pass.

    Make sure that you re-download 0.9.1.2 to overcome the error you're experiencing.

  23. Don
    Member
    Posted 4 years ago #

    I installed W3 Cache and it's working, maybe too well.

    Firefox caught a problem with RPC Blogrolling and report an "Attack" problem shutting my one site down concerning the Blogroll.

    I removed blogrolling script and changed all blogroll links manual to reflect standard links. These don't change often so the work is complete.

    Now...on my desktop, in Firefox, the links in the sidebar appear fine.

    However, I went to the site via my laptop, aircard internet connection and the "blogroll" is still appearing shutdown.

    Also, I removed Kontera in-text links which are not showing up on my site via the desktop but also continue to appear on the laptop.

    One difference, I'm logged in to the site on the desktop not the laptop, I don't think this should matter. (Sorry for the long discussion)

    My question is - What is caching that can be cleared to correct the site on the laptop or anyone else's views who have visited and returned only to get the cached version of the site?

    I clear everything on Firefox on the laptop, restarted it but no change.

    Is my setup with W3 Caches causing this?

    Bottom Line: Logged off the old info is showing that I actually removed such as the Kontera ads and the Blogrolling Blogroll script.

    Any constructive help would be greatly appreciated. Thank you.

  24. Don
    Member
    Posted 4 years ago #

    Small Update on my post:

    I went back to the site, not logged in using Firefox (It all works great in IE).

    The new linked blogroll is still missing. I scroll down and click 'next page' and on the second page the blogroll appears.

    Click the link to a single post and the blogroll appears.

    So the problem seems isolated to the front page only.

  25. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    Are you posting this issue in multiple topics (threads)?

  26. Don
    Member
    Posted 4 years ago #

    I originally posted in a new thread then ran into this one so I posted after no replies in the other thread. "W3 Cache Plugin"

    Sorry to create any confusion. You have replied in that thread.

  27. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    Ok.

  28. Dennis8
    Member
    Posted 4 years ago #

    Javaman, hijacking a thread is not very nice. I dont appreciate it. Just have a little patience with your own thread(s), ok?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic