First off, I don't think that you really need to worry about this too much. This all sounds like premature optimization. Local filesystem latency should be minimal enough that you likely won't be able to notice the difference. Are you in fact running into perf problems with local page load time for your extension?
That said, I'll take a stab at answering your questions. As you suggest, for extensions, caching should not enter into it unless you're sharing resources across multiple pages. Then the local script and image caches would kick in. If they're only used by a single file, then total load time should be reduced if everything is combined into a single file. However, it's not always the case that you're optimizing for total load time. For example, it may be better for a popup to display more quickly without any images and then for the images to appear afterwards. Your question about base64 encoding your images into data URLs is a little harder to answer definitively. Having it combined into the single file should reduce disk seeks in most cases. However, it does cause the size of the data to grow by 33%. If your hard drive is full or fragmented, and your image is large, then this could lead to more seeking than having it as a separate smaller file. Erik On Thu, Dec 3, 2009 at 2:31 AM, Billiam <[email protected]> wrote: > For a complex page, should I: > Separate out css, javascript and javascript libraries into individual > files, and including them via <script src="js/myfile.js"> and <link> > in the page's head? > > Or: > > Add the contents straight into the head of the document (assuming > there's no css/js reuse across multiple documents)? > > For a non-local webpage, there's a performance advantage to the first > one, since those assets will be cached by the browser. > > For a page running from a local directory, though, am I just > introducing an unnecessary delay while the individual assets are > fetched from disk? > > Similarly, am I better off fetching images from individual jpg files, > or base64 encoding them and embedding them in the HTML document, aside > from the inconvenience during development. > > -- > > You received this message because you are subscribed to the Google Groups > "Chromium-extensions" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<chromium-extensions%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/chromium-extensions?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.
