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

The Archive Base Latest Questions

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

I have two websites that will share some resources, lets say, index.php, functions.js and

  • 0
  • I have two websites that will share some resources, lets say, index.php, functions.js and style.css, and these scripts will be used on almost all pages on the websites.
  • I have two audiences to cater for (in terms of download speed), the users within the same network that the sites hosted on (100mb/s aprx) and external users.

I am looking for the best way to cache each kind of script (.js, .css, .php) and examples of how this would be done with their pros and cons over other methods if possible. By caching I mean locally, network and server caching.

Note: index.php is a dynamic page which should be refreshed from cache every 2 hours. It would be nice if you start your answer with .js, .css, .php or a combination so I can easily see what type of script you are talking about caching.

Thanks All!

  • 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-26T17:29:24+00:00Added an answer on May 26, 2026 at 5:29 pm

    Performance tuning through cachine could be categorized into multi-layers:

    • Client-side (JS and CSS): Add an Expires or a Cache-Control Header will get it done for you. But note that there are more to do than only caching to enhance client-side performance. For detailes check Best Practices for Speeding Up Your Web Site
    • Server-side: this could be on many levels web server, scripting language, database, operating system, network, etc..

    Good introduction and practical code examples can be found in Chapter 9 (Performance) – Developing Large Web Applications. It will talk about Caching CSS, Javascript, Modules, Pages, Ajax and Expire headers.

    If we need to keep things simple on server-side do the following:

    1. Install APC extension which will make PHP faster for you through the so called opcode caching. No special configuration, it will work silently for you.
    2. Cache the full page for two-hours using this simple Pear library PEAR::Cache_Lite.
    3. For each database SELECT query cache the result in APC with a TTL of 5 Min, md5 hash the SELECT statement and use it as key for APC cache. Docs

    In future if you have multiple servers and the performance becomes to be crucial before then you will need to look at:

    1. Shared memory caching between servers. Check Memecache or even Membase
    2. You need a reverse proxy solution: this basically layer between your user and server server so that it will serve the HTTP requests instead of your server. You can use for that Varnish, Squid or Apache Traffic Server.
    3. Mysql innoDB engine is slow, you may need to go for faster engine such as XtraDB
    4. Then maybe you will find that rational databases are stil slow for you. Then you will go for the key-value solution such as MongoDB.

    Finally as references in web application performance check:

    1. Front-end Performance: High Performance Web Sites, Even Faster Web Sites and High Performance JavaScript.
    2. Back-end Performance: Pro PHP Application Performance and High Performance MySQL
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have resources for two websites located here... localhost/index.php /* rewrite handler */ localhost/images/
Do anyone have experience in crafting CSS stylesheets for websites that will implement CushyCMS?
I have two websites that post news information. I just got a request to
I have two websites that have an almost identical database schema. the only difference
I have two websites, let's say they're example.com and anotherexample.net . On anotherexample.net/page.html ,
I have two websites: http://example.com http://example.com/sub I have a page, let's say: http://example.com/sub/page1 Is
I have two websites: one with Lighttpd with PHP and second with Apache and
I have two webapps that will both be sitting on the same domain/tomcat application
I think the title is clear, but I will elaborate. I have two websites
I currently have an asp.net website hosted on two web servers that sit behind

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.