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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:49:15+00:00 2026-06-03T05:49:15+00:00

Let’s say my page structure is : 1. one.html : includes -> a.js ,

  • 0

Let’s say my page structure is :

1. one.html :
   includes ->   a.js , b.js , c.js ,d.js

2. two.html :
   includes ->   a.js , b.js,  x.js, y.js, z.js

3. three.html :
   includes ->   a.js , b.js, s.js,  x.js, y.js

and so on.
Some pages are more visited than others, say 3 pages contribute 99% of all page views of the website.

I am looking for a solution to:

i) Combine and minimize files in groups which can be included in the pages.

ii) Has some logic to map files names of the group, to final combined file name.

iii) Includes a minifier like Google Closure compiler / YUI compressor.

One solution I have looked at is:
PHP minify

which does most of it. However it has following drawbacks for me:

i) I would be hosting my static combined files on a CDN server,not on same web server hosting PHP minify, hence PHP minify’s logic to server files by group name does not work for me.

ii) PHP Minify uses PHP CGI to process and serve the scripts, whereas I would want my minified content to be served directly from the CDN server.

Does PHP Minify have some functions to map group name to combined file name, which I can use in my webpage to directly set CDN path of the combined JS file. eg

<?php
  $groupName = array("onePage" => array('a.js','b.js','c.js','d.js');
?>

<script type="text/javascript" src="http://www.MYSTATICSERVER.com/js/<?php getMergedFileName($groupName)"></script>

Rather than calling PHP Minify’s PHP script to get files of a group, which is
actually a PHP page call,which then serves the javascript content from previously
generated files:

<script type="text/javascript" src="http://www.MYWEBSERVER.com/min/?g=onePage" ></script>

( I agree most of this is doable by combining different solutions with custom deployment scripts and minifying tools eg ANT,FABRIC + YUICompressor/ClosureCompiler, but I am looking for a well developed configurable solution that I might have missed )

  • 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-03T05:49:16+00:00Added an answer on June 3, 2026 at 5:49 am

    Updated to show example for minify

    It does appear doable using minify. I’m not sure if you have tried this out, but putting it out there for anyone else who might need it

    1) Minify can generate a combined and gzipped copy of your scripts and use it as a cache so that it need not process all your files for ever request. To enable this, just edit config.php file with the location of the temp directory

    $min_cachePath = 'c:\\xampp\\htdocs\\min\\cache';
    

    2) After you add all your groups in groupsConfig.php, just make a request to each group so that minify generates the outputfiles in the cache folder

    3) For each group, you will find 2 files in the temp folder named so:

    minify_g=group1_08da191ba9c60a0ed611d0de455bb7a4
    minify_g=group1_08da191ba9c60a0ed611d0de455bb7a4.gz
    

    4) You can rename the files and deploy them directly to your CDN as required

    5) If your CDN allows url rewriting, you can rewrite your script url to serve up the JS, without the need to change the location in the pages that you serve.

    Unless you have a huge number of different configurations, I’d recommend you do it using YUICompressor and deploy to your CDN network. It is actually quite trivial to automate something like that using a simple shell script. If however you have a really complicated setup, you can consider using a build tool like grunt that runs on top of node.js. I have been using Grunt to build JS files for different projects using the same codebase, and it works quite well. In addition, lint and compression are supported OOTB.

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

Sidebar

Related Questions

Let's say I have a structure named vertex with a method that adds two
Let say I have some code HTML code: <ul> <li> <h1>Title 1</h1> <p>Text 1</p>
Let's say you create a wizard in an HTML form. One button goes back,
Let's say i have two tables in db: Car and Part. Car owns arbitrialy
Let's say I have two tables orgs and states orgs is (o_ID, state_abbr) and
Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>
Let's say there is a graph and some set of functions like: create-node ::
Let's say I have a C++ Visual Studio 2010 solution with 2 projects: one
Let's say I have the string: hello world; some random text; foo; How could
Let say I have two UIViews: View1: - bounds: 0, 0, 20, 20 -

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.