css minification

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 16 13:32:08 PST 2015


On Friday, 16 January 2015 at 21:26:04 UTC, Andrei Alexandrescu 
wrote:
> Well good point. As of January two of the css files are in the 
> top 3 most trafficked files off of dlang.org, second only to 
> favicon.ico.

That's probably because HTTP caching is not configured.

Ideally, you'd put the file's modification time in its path, e.g.:

<link rel="stylesheet" type="text/css" 
href="css/1421443851/style.css" />

css/*/style.css would point to the same style.css (via internal, 
not HTTP redirect).

Then, css/* can be cached forever, as the URL of the file would 
change when the file changes.

This is what DFeed does, but I'm not sure if this is feasible 
with just DDoc and makefiles, though.


More information about the Digitalmars-d mailing list