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 753547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:54:37+00:00 2026-05-14T14:54:37+00:00

I am working on a rails application that uses big javascript libraries (e.g. jquery

  • 0

I am working on a rails application that uses big javascript libraries (e.g. jquery UI), and I also have a handful of my own javascript files. I’m using asset packager to package up my own javascript. I’m considering two ways of serving these files:

  1. Link to the jQuery libraries from Google Code as described at http://code.google.com/apis/ajaxlibs/documentation/#jquery , and separately package up and serve my javascript files using asset packager.

  2. Host the jquery libraries myself, and package them together with my own javascript as one big merged javascript file.

My hosting solution is of course not going to beat out Google’s content delivery network, so at first I assumed that end users would experience faster page loads via option #1.

However, it also occured to me that if I serve them myself, users would only need to issue one request to get the merged javascript (as opposed to one for my merged javascript and another for the libraries served by google).

Which approach will provide the best end-user experience (presumably in the form of faster load times?)

  • 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-14T14:54:37+00:00Added an answer on May 14, 2026 at 2:54 pm

    I would say “it depends”, but in most cases I’d go with Option #1 (Google hosting) for an internet facing site. For an intranet I’d host everything internally for a number of reasons, but that’s outside the scope of your question it looks like.

    There’s a few things to consider overall:

    • Your users aren’t downloading the file except on forced refresh if it’s cached correctly.
    • Google has more servers than you 🙂 lots more, and they’re geo-located to best serve any given request, I would guess that your hosting from a single or few locations.
    • The browser parallelizes downloads, even if it executes the script sequentially, so it’ll download from you and google at the same time, increasing throughput.
    • Other sites use google for hosting jQuery (you’re on one now), if the user has been to any of those, they already have the file cached, meaning no request was made.

    You can host all the files in one file, but you have to consider the weight of a few things with this:

    • How large is that one file going to be, do you users need to download the entire thing again when you changed something in your script?
    • Are the multiple requests (and DNS lookups) cheaper than the download time for that file
    • Do you pay for bandwidth? 🙂

    Depending on what percentage of the code is custom and how much is framework, Google’s CDN can take a substantial part of your static js traffic off your server, leaving it available to serve and do other things (that’s a huge benefit to a high traffic site), and when you change your script (much more common than a new framework release)…the client downloads only that, not the entire framework again.

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

Sidebar

Ask A Question

Stats

  • Questions 426k
  • Answers 426k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes, its a bad idea! You lose out on the… May 15, 2026 at 12:42 pm
  • Editorial Team
    Editorial Team added an answer Typically this will rely on some amount of URL-rewriting support… May 15, 2026 at 12:42 pm
  • Editorial Team
    Editorial Team added an answer If your linked list doesn't have loops, then the fact… May 15, 2026 at 12:42 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.