htmlcompressor icon indicating copy to clipboard operation
htmlcompressor copied to clipboard

Shrinking classes and IDs

Open GoogleCodeExporter opened this issue 10 years ago • 2 comments

It seems Gmail does it and I think it's worth the effort (eg. #foo -> #a, #bar 
-> #b, .baz -> .a). I do know though, that it might be difficult to implement.

Original issue reported on code.google.com by [email protected] on 17 Jul 2011 at 12:57

GoogleCodeExporter avatar Nov 27 '15 21:11 GoogleCodeExporter

Some of those ids and classes are likely to be used in javascript, so it would 
require some configuration saying which classes to skip or something. It might 
make sense for google with its traffic to go for such extremes, but for regular 
sites it probably isn't worth the effort.

Besides I did some testing some time ago to see how much this would save - the 
result wasn't impressive, it only decreased the html size by about 10%.

Lets leave this issue open for now, if more people think this is something they 
want to do on their sites, I will look more closer into it.

Thanks.

Original comment by [email protected] on 17 Jul 2011 at 3:30

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

GoogleCodeExporter avatar Nov 27 '15 21:11 GoogleCodeExporter

I thought about this feature before, and none of the html compressors I found 
did that, so I just forget about it.

10% is pretty big saving IMHO, which means if ten pages use HC , then users can 
avoid to download a page all together.

But the implementation is not easy I guess, especially designing the 
configuration to denote strings contain classses and IDs in js.

Anyway, +1.

Original comment by [email protected] on 8 Dec 2011 at 9:15

GoogleCodeExporter avatar Nov 27 '15 21:11 GoogleCodeExporter