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

  • Home
  • SEARCH
  • 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 8816253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:34:42+00:00 2026-06-14T04:34:42+00:00

My current code I have started writing an API that loads, minifies and returns

  • 0

My current code

I have started writing an API that loads, minifies and returns javascript files into one file using PHP. This is achieved by pointing to a PHP file from a script tag in HMTL like so:

<script type="text/javascript" src="https://libraries.sinemaculammviii.com/jsapi.php"></script>

This jsapi.php page processes the javascript files and outputs the minified javascript, with the header:

header("Content-Type: text/javascript");

My Question

Is this a bad method to load javascript files? Would it be much faster and reliable to load the javascript files individually by simply pointing to the .js file in the src attribute?

If you wish to see my code for the the full API, have a look at this. The mentioned link also explains in detail what it is I am doing and why.

  • 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-06-14T04:34:44+00:00Added an answer on June 14, 2026 at 4:34 am

    Faster as .js yes, but marginally. The reason being that it would be a static file so wouldn’t need the processing time PHP will take.

    That said there’s nothing wrong with feeding JavaScript through PHP like this. You could even come up with caching methods as well to reduce the processing impact.

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

Sidebar

Related Questions

I have some code that gets the current logged in user. userID = request.session.get(_auth_user_id)
I have the following code that creates a submenu based on current document. The
We have started using Hudson, and the current workflow is: checkout locally > code
In writing some code today, I have happened upon a circumstance that has caused
I am having a bit of difficulty with this current code I have set
The code i current have is this. function update (){ latest_id = $('#image:first').data('position'); /*
As a beginner in Ocaml, I have this current working code: ... let ch_in
I have following code return (EseshEntities.Current.Users.Select(u => new { Comunity = u.Apartment.Building.District.City })).ToList(); if
I have my current google maps code working to the point where if I
I have this following code which will return all the current semesters. How do

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.