The output from Sphinx, the python documentation generator, results in a large number of HTML files. Each one has a header with a large number of JavaScript and CSS includes:
<link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="stylesheet" type="text/css" href="../_static/custom.css" />
<link rel="stylesheet" type="text/css" href="../_static/colorbox/colorbox.css" />
<script type="text/javascript" src="../_static/colorbox/jquery.colorbox-min.js"></script>
Most of these are minified individually, but this is still suboptimal because it requires separate requests to the webserver when the client's cache is empty. Is there a tool like YUI Compressor or the Closure Compiler that will take HTML files as input, compress all of the individual externally-linked scripts, and then rewrite the output? This would be similar to what django_compressor does.
Agree with Above answer.
You can do one other thing.
Put all Scripts after Body instead of header. May be it will increase your loading speed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With