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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:38:33+00:00 2026-05-15T10:38:33+00:00

I need your opinions and knowledge on a subject. I’m developing on a website

  • 0

I need your opinions and knowledge on a subject.

I’m developing on a website that uses a good amount of JavaScript. In a script tag at the end of the body tag I call a PHP file, which gathers all my JS files and combines/compresses them into one (shorter) file, so I can reduce the number of HTTP calls to the server.

This is all fine and somewhat standard. Now here is my question:
Wouldn’t it be faster and easier to exclude the src attributed script tag and just output all the JavaScript directly into the script tag in the first place? Wouldn’t that save the call from the received PHP file on the users browser back to the server again to collect those JS files?

To clear it up a little:
Instead of the user first having to download an HTML file, which then calls back to the server to get the JS file (output from the PHP file), he/she would just download one html file which then had the JS “hardcoded” into a script tag and thereby cutting the second server call.

Is this a reasonable idea? Is it a bad idea to include the javascript directly into the page? It’s all dynamically created… It’s normally best practice to include JS files, but it seems that that would only load the server even more… Am I onto something or should I just let it be?

Looking forward to hear what you have to say,

Regards Mikkel, Denmark

  • 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-15T10:38:33+00:00Added an answer on May 15, 2026 at 10:38 am

    Just add a conditional GET into your js gathering script and you will be fine.

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

Sidebar

Related Questions

I need your expertise once again. I have a java class that searches a
I need some resources that talk about how to design your software to be
.NET developers out there! Need your opinion here! I am now using Visual Assist
I need your help, For example I have a decimal type variable and I
I need your help to define a special case in XML schema: A sequence
I really need your help in my issue very quickly and it's too close
I've some questions .. and I really need your help. I have an application.
I would like to know your experience when you need to take over somebody
What are your best usability testing tips? I need quick & cheap.
Do you need to use some kind of provider? Can you setup your own

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.