Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6200715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:25:09+00:00 2026-05-24T04:25:09+00:00

Common advice is to keep your CSS and JS files external. The reason: What

  • 0

Common advice is to keep your CSS and JS files external. The reason: What you lose in the additional HTTP request*, you often gain back by not having to download cacheable static content (which CSS and JS usually is).

However, the smaller your external file, the more penalizing the additional HTTP request — even if it is a 304 Not Modified response. So the smaller the external file, the more reason to favor inlining your CSS and JS content, at least when speed is your primary concern.

I ran some tests. Without going through the details, my results look like this:

External File Size    Average Gain
----------------------------------
               1KB          -3.7ms
               2KB          -3.7ms
               4KB          -4.0ms
               8KB          -3.0ms
              16KB          -2.7ms
              32KB           1.0ms
              64KB           2.7ms
             128KB          10.0ms
             256KB         493.7ms
             512KB        1047.0ms
            1024KB        2569.7ms

My general conclusion is that using external files doesn’t really matter until they get BIG. And by BIG, I mean the 50-100KB range… And that’s minified and gzipped, if you take advantage of those.

Can anyone confirm or refute these results with additional data?

(* Assuming you don’t use the HTTP “Expires” header)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:25:10+00:00Added an answer on May 24, 2026 at 4:25 am

    I don’t have additional data, but I can confirm that your results logically make sense. Most people today are on fast broadband connections, and most web servers will automatically gzip any text-based content that they send, so in many cases the overhead of sending a second request to load an external resource (or verify that it has not been modified) is going to be greater than the cost incurred by downloading a bit more data as part of the original request.

    You can even work this out mathematically if you want, by assuming an average connection speed of 5 Mbps and a typical round-trip time of 100 ms. With those assumptions you will see that you can add up to approximately 62,500 bytes to the payload of the first request before the overhead of making the second request becomes justified. And that correlates very nicely with your numbers.

    However, that doesn’t mean that “using external files doesn’t really matter”, as there are other reasons to use them apart from the caching/page-load aspect. For instance, they help keep your code and overall site structure sane, particularly if you have common CSS styles and JavaScript utilities that are reused across multiple pages. I’d argue that this is at least as important as any small gain or loss in page-load time that you might get from using/not using external files. So in that context using external files makes sense even for smaller resources.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following the common advice I'm trying to do the batch get(), that is: prepare
I'm having trouble finding good advice and common practices for the use of namespaces
the reason I asked the question was because after reading the msdn advice on
Background With respect to cryptography in general, the following advice is so common that
Common question but I could use an english explanation. Is it like Java where
Common scenario: I have a library that uses other libraries. For example, a math
Common problem I'm sure, but I can't figure it out. In my AndroidManifest.xml and
Common situation: I have a client on my server who may update some of
A common task in programs I've been working on lately is modifying a text
A common pattern in C++ is to create a class that wraps a lock

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.