<?xml version="1.0" encoding="windows-1252"?>
<node id="981238" title="PM CSS and markup optimizations" created="2012-07-11 15:33:02" updated="2012-07-11 15:33:02">
<type id="1036">
monkdiscuss</type>
<author id="910459">
kimmel</author>
<data>
<field name="doctext">
&lt;p&gt;While working on the redesign I became familiar with the existing CSS on PM. When an anonymous user loads the main page two CSS files are downloaded. &lt;a href="/css/common.css"&gt;common.css&lt;/a&gt; and [id://204962]. Using different tools and verifying against a &lt;a href="https://github.com/kimmel/perlmonks-redesign/blob/master/reports/css_spider_log.txt"&gt;list of 105 PM pages&lt;/a&gt; I was able to determine what CSS was &lt;a href="https://github.com/kimmel/perlmonks-redesign/blob/master/reports/unused_css_selectors.txt"&gt;not being used&lt;/a&gt;. This CSS can be removed which mean less data needs to be sent to the end users.&lt;/p&gt;
&lt;p&gt;HTML comments were another thing I found that can be stripped out. Here is the before and after of the main page:&lt;/p&gt;
&lt;pre&gt;
Current version:
$ wc pm_divs.html 
 1545  6537 73719 pm_divs.html

After stripping comments:
$ wc pm_divs.html 
 1515  5942 70317 pm_divs.html
&lt;/pre&gt;
&lt;p&gt;A savings of 3,402 bytes for the main page and similar savings for all other pages on the site as well. Talk about some major bandwidth savings. I also found empty paragraph tags that I stripped out as well. Furthermore I noticed that the content being delivered does not include ‘Content-Encoding gzip’ or any other indication of compressions. As numerous studies have shown &lt;a href="http://www.ibm.com/developerworks/web/library/wa-httpcomp/"&gt;compression is a good thing&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So why is there no compression before transmission of a web page?&lt;/p&gt;

&lt;p&gt;Edit: Linked to the CSS files.&lt;/p&gt;</field>
</data>
</node>
