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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:27:23+00:00 2026-05-26T16:27:23+00:00

So, recently, after accruing quite a few js and css files, I began thinking

  • 0

So, recently, after accruing quite a few js and css files, I began thinking about all of the http calls I was making.

Since I use PHP inlcude for the page headers and footers, every page was calling every script which was really inefficient. So I started using conditional statements in the pages with php to call only the needed files.

Then I thought, hey, wouldn’t it be smarter to cut down on all of these http calls (even now every page has more than a few external js or css files) by making one huge css.php, and one huge js.php, and just include them in the header and footer respectively, and use conditional statements within those files?

The end result would be that those large files would be processed server side, and each page would get its css directly in the head and jss directly in the bottom of the body, with all of the code it needs and no more than that.

Is there any reason not to do this? Any thoughts in general on this idea? Is everyone else already doing this and I just missed the boat?

  • 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-26T16:27:24+00:00Added an answer on May 26, 2026 at 4:27 pm

    I would have liked to award this answer to Marc, but he didn’t formally answer and everyone else was off base. Maybe I didn’t ask the question clearly enough.

    In any event, the answer is that this shouldn’t really be done, as though it is efficient that each page gets only the css and js it needs and extraneous HTTP requests are avoided, the resulting files are always unique for each page and thus, not practically cache-able.

    Thanks for everyone’s input!

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

Sidebar

Related Questions

I recently started reading about ASP.net MVC and after getting excited about the concept,
I recently ran into a quite complex problem and after looking around a lot
We recently started working with XML files, after many years of experience with the
Recently our WPF/Entity Framework 4.0 application has become unstable after we began using backgroundworkers
After Eclipse starts I see only 4 recently opened files. Is it possible to
Recently (after installing Windows 7?) I have been experiencing problems when blaming files with
After reading about valHooks in a jQuery defect and more recently seen in a
I recently heard about JavaScript Object Notation (JSON), and after looking it up, it
I have recently started to use Eclipse after using IntelliJ for a few years.
Recently I have started using Lucene. However, after few days I've spotted that queries

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.