http - Request multiple S3 files into one request -
is there way multiple files s3 (or cdn) in 1 request?
for example, have 4 files on s3:
- example.com/cdn/one.js
- example.com/cdn/two.js
- example.com/cdn/three.js
- example.com/cdn/four.js
i able request combination of them @ time. have include them separately:
<script src="example.com/cdn/one.js" /> <script src="example.com/cdn/two.js" /> but include them 1 request:
example.com/cdn/code.js?one&two i've considered combining needed combinations single files, there way many combinations realistic. i've considered combining of them 1 file, ridiculously large.
first of all: question more js thing related s3 / cdns in general. , answer question: you can't "combine" them in 1 http request.
if don't want concatenate , minify them should take @ requirejs, handle loading of scripts – it's async , won't block browser rendering.
this great article async loading: css-tricks.com - thinking async give better insight.
edit after comment:
you can in fact use php concatenate & minify js files on fly, put additional load on server , you'll loose benefits cdn … approach using build system, packs before goes production.
for further information on topic take @ following links:
to on fly minifaction on dev system (if it's mac) may want try codekit.
Comments
Post a Comment