> Thanks Peter and Matthew.
>
> I followed Peter's approach and still ended up with 32 file requests.
> Is there supposed to be that many?
>
> It's better than the 60+ requests I get without the layer, but still...
>
> Thanks again.
>
No. With the layer approach you will have two js resources loaded:
dojo.js and layer.js -- depending on what is in the layer, you may see
one request for i18n bundle for the locale. What are the url's for the
additional requests being made?
One step I didn't mention in the last note is cssOptimize ... if you are
using Dijit, you'll need a theme obviously, but for maintainability the
themes are broken into many small files based on widget. tundra.css is
simply a list of @imports in a -src release. In the "release", we use a
command line option cssOptimize=comments.keepLines
cssImportExclude=../dijit.css
This makes a tundra.css "layer" of all the @imports (you can do this too
in your my/ namespace, provided the css files all use relative locations
to images and such), and excludes the @import "../dijit.css"; You can
skip the exclusion of dijit.css, we do this step for backwards
compatibility.
I suspect the majority of your requests are CSS, as cssOptimize is not
on by default, so running it against a clean checkout or -src release
will not build the theme rollups.
So, dojo.js, layer.js, nls/layer-en.js, tundra.css, and however many
images are referenced in css and being used in the dom would be your
initial expected request count. I suppose it _could_ be 32 including
images, depending on how many widgets you are using. Some use sprites,
others cannot ...
Regards,
Peter Higgins
没有评论:
发表评论