wpsharks / html-compressor

HTML Compressor. Combines and compresses CSS/JS/HTML code.
https://websharks.github.io/html-compressor/
GNU General Public License v3.0
38 stars 9 forks source link

Additional Tests with the Latest Debug Info #27

Open jaswrks opened 10 years ago

jaswrks commented 10 years ago

Given the recent improvements in the debug information provided by the HTML Compressor, as seen in #19; I would like to take a closer look at these two reports specifically, which seem to need further optimization.

<!-- Quick Cache HTML Compressor took 1.71579 seconds building parts based on CSS tag frags in checksum: `e19c6d1c4cb3192773afec0733c65c5b`. -->
<!-- Quick Cache HTML Compressor took 1.72399 seconds compressing/combining head/body CSS in checksum: `894d509e5425bfc35879c7a9fb9bb9ba`. -->
raamdev commented 10 years ago

I'm seeing this too on my site (raamdev.com). In fact, I'm seeing something really peculiar stuff in the latest Quick Cache Pro (v140714 RC) related to the HTML Compressor:

With the HTML Compressor enabled, the first time a page is cached it sometimes takes a long time, like 30 seconds+. I suspected a slow remote file retrieval during the compression, but enabling the detailed debugging reports nothing out of the ordinary:

<!-- Quick Cache HTML Compressor took 0.00855 seconds compiling CSS tag frags in checksum: `5295d30d71e7fec416d3d9086e3c3181`. -->
<!-- Quick Cache HTML Compressor took 0.00227 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/jetpack/modules/subscriptions/subscriptions.css?ver=3.9.1`. -->
<!-- Quick Cache HTML Compressor took 0.00159 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/crayon-syntax-highlighter/css/min/crayon.min.css?ver=2.6.5`. -->
<!-- Quick Cache HTML Compressor took 0.00113 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/bitcoin-tips/style.css?ver=3.9.1`. -->
<!-- Quick Cache HTML Compressor took 0.00107 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/further-reading/style.css?ver=1.0`. -->
<!-- Quick Cache HTML Compressor took 0.00105 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/indiepub-current-location/style.css?ver=1.0`. -->
<!-- Quick Cache HTML Compressor took 0.00202 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/jetpack/_inc/genericons/genericons.css?ver=3.0.3`. -->
<!-- Quick Cache HTML Compressor took 0.00120 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/indiepub-spoken-essay/style.css?ver=1.0`. -->
<!-- Quick Cache HTML Compressor took 0.00103 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/wp-email/email-css.css?ver=2.60`. -->
<!-- Quick Cache HTML Compressor took 0.00106 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/jetpack/modules/widgets/widgets.css?ver=20121003`. -->
<!-- Quick Cache HTML Compressor took 0.00112 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/themes/independent-publisher/css/jetpack-sharing-enhancements.css?ver=1.0`. -->
<!-- Quick Cache HTML Compressor took 0.00110 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/themes/independent-publisher-child/style.css?ver=3.9.1`. -->
<!-- Quick Cache HTML Compressor took 0.00260 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/themes/independent-publisher/style.css`. -->
<!-- Quick Cache HTML Compressor took 0.00116 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/snazzy-archives/snazzy-archives.css`. -->
<!-- Quick Cache HTML Compressor took 0.00107 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/snazzy-archives/snazzy-archives.css`. -->
<!-- Quick Cache HTML Compressor took 0.29243 seconds fetching remote resource: `http://raamdev.com/?custom-css=1&amp;csblog=1&amp;cscache=6&amp;csrev=8`. -->
<!-- Quick Cache HTML Compressor took 0.00138 seconds fetching remote resource: `http://raamdev.com/wordpress/wp-content/plugins/snazzy-archives/snazzy-archives.css`. -->
<!-- Quick Cache HTML Compressor took 0.04502 seconds compressing CSS w/ checksum: `112b33424194e356071cad797f82cf9f`. -->
<!-- Quick Cache HTML Compressor took 0.36707 seconds building parts based on CSS tag frags in checksum: `748915bd2a19a50bc35dd190a122c059`. -->
<!-- Quick Cache HTML Compressor took 0.37978 seconds compressing/combining head/body CSS in checksum: `524dd1849abcb7cd0b2a37c52cb4cea2`. -->
<!-- Quick Cache HTML Compressor took 0.00082 seconds compiling JS tag frags in checksum: `2e84fa451e4651720df36d88876b792e`. -->
<!-- Quick Cache HTML Compressor took 0.00019 seconds building parts based on JS tag frags in checksum: `8b647cc0ae5b47bb394c9a4cd95703b4`. -->
<!-- Quick Cache HTML Compressor took 0.00153 seconds compressing/combining head JS in checksum: `caca31884ad3e4dc38f69a05925acc64`. -->
<!-- Quick Cache HTML Compressor took 0.00025 seconds compiling JS tag frags in checksum: `48409e67ec45c157c2b116ef27cd5134`. -->
<!-- Quick Cache HTML Compressor took 0.00015 seconds building parts based on JS tag frags in checksum: `a48935e71f618cc50994d9c079d76607`. -->
<!-- Quick Cache HTML Compressor took 0.00076 seconds compressing/combining footer JS in checksum: `43135fb4e92a18d82cd70dec00b58605`. -->
<!-- Quick Cache HTML Compressor took 0.00469 seconds compiling JS tag frags in checksum: `a535c1c79b72eb9c6d4876c88ed1ea68`. -->
<!-- Quick Cache HTML Compressor took 0.01058 seconds compressing inline JS in checksum: `9bc8cd7f2496bf5d2e113f2a108c1e38`. -->
<!-- Quick Cache HTML Compressor took 0.01087 seconds compressing HTML w/ checksum: `5a1a9fd35706aeee6a6068e9dd6f451e`. -->

<!-- Quick Cache HTML Compressor took 0.40419 seconds (overall). -->
<!-- Quick Cache file path: /cache/quick-cache/cache/http/raamdev-com/2010/frugal-travel-report-for-march-2010.html -->
<!-- Quick Cache file built for (http://raamdev.com/2010/frugal-travel-report-for-march-2010/) in 0.74799 seconds, on: Jul 15th, 2014 @ 2:52 pm UTC. -->
<!-- This Quick Cache file will auto-expire (and be rebuilt) on: Jul 22nd, 2014 @ 2:52 pm UTC (based on your configured expiration time). -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- Quick Cache fully functional :-) Cache file served for (http://raamdev.com/2010/frugal-travel-report-for-march-2010/) in 0.00058 seconds, on: Jul 15th, 2014 @ 2:53 pm UTC. -->

Despite the above report from Quick Cache, here's what Google Chrome reported on the Network tab:

2014-07-15_10-54-41

I then refreshed the page again (after having just cached the page and after the HTML Compressor built its cache) and this time it was the receiving of the HTML Compressor cache file (for compressed CSS) that seemed to take forever (24s) to get to my browser:

2014-07-15_10-58-03


This could certainly be an edge-case, related to my network connection or something else (the Chrome Network graph would indicate a network issue, not a QCP issue). I haven't been able to consistently reproduce this, however whenever I was able to reproduce it disabling the HTML Compressor seemed to "fix" the problem. I'm reporting my findings here in case they're helpful.

jaswrks commented 10 years ago

@raamdev If you notice this again, can you please post a copy of the JS or CSS file that was hanging?I'd like to take a look at what ended up inside this file that was hanging on you. Just to see if there is corruption occurring somewhere and the browser is somehow hanging on that.

Still trying to reproduce this myself also.

raamdev commented 10 years ago

Will do. I'll run a few more tests today and report back.

jaswrks commented 10 years ago

TODO: