Search code examples
phphtmlperformanceheadermultipart

HTML / PHP - How to "pack components into multipart documents"?


Seems like a straightforward question but there must be something I'm missing.

Perusing the famous Yahoo "high performance frontend" recommendations, I came across the phrase

Pack components into a multipart document

and then short brief blurbs which didn't really elaborate very much on the how-to side of things.

I know there's a multipart header, and that emails are split using multipart boundaries, but further searching hasn't revealed much more...can someone explain what the heck this means and what situations it applies to?


Solution

  • The multi-part documents, I believe, only works well with IE; the idea is to pack the HTML and all images into one document (like how mime emails work).

    See also: http://en.wikipedia.org/wiki/MHTML

    I wouldn't go down this route; I think it's better to just aggressively cache your external scripts, images and style sheets. It's just more practical and in most cases will yield the same performance.