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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:16:59+00:00 2026-05-26T06:16:59+00:00

i am running multiple websites with high traffic , as a requirement , all

  • 0

i am running multiple websites with high traffic , as a requirement , all images are downloaded via image.php?id=IMAGE_ID_HERE .
If you ever done that before , you know that that file will be reading the file image and echoing it to the browser with special headers .

My problem is , the load on the server is very high (150-200) and TOP command shows multiple instances of image.php , so image.php is running slow !

the problem probably is fopen loading the image to the memory before sending it to the client. How to read a file and pass it through directly?

Thank you guys


UPDATE

After you optimized the code, used caching wherever possible, do create a CDN . couple of servers, sync methods, load balancers and no need to worry about requests anymore 🙂

  • 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-26T06:16:59+00:00Added an answer on May 26, 2026 at 6:16 am

    fopen and file_get_contents are nearly equivalent

    to speed up with consistence the page load you can use

    http://www.php.net/fpassthru

    or, even better

    http://www.php.net/readfile

    with those functions, content of file is printed directly, byte per byte

    as opposed to file_get_contents, for example, where you store the whole data inside a variable

    $var = file_get_contents();
    

    so, to make these work correctly you will need to disable output buffering (otherwise it would make readfile() pointless) in the page that serves the images

    hope this helps!

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

Sidebar

Related Questions

I run multiple websites all running off of a single installation of CodeIgniter on
Given multiple websites all running the same sourcecode, what's the best/most maintainable way to
I am running multiple screens from one ssh connection, when I list all of
I am building an automation test suite which is running on multiple machines, all
We are running multiple Sitecore websites and just got feedback that it might be
We run multiple websites which use the same rich functional backend running as a
I'm running multiple content/design separate websites from same middleware and I want to use
I am creating a setup, where I have multiple drupal websites running. I am
We're looking into running multiple instances of Tomcat from the same copy of the
Currently we are running multiple Sitecore projects. Whenever the projects go live we create

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.