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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:47:39+00:00 2026-06-01T02:47:39+00:00

I have a web application build on PHP that (does some processing and) displays

  • 0

I have a web application build on PHP that (does some processing and) displays images hosted on external servers. Some of these images (i.e. from Flickr) when they are deleted, leave a redirect behind that points to a “Missing Image” gif or something equivalent.

By using the get_headers() function in php on each image, I was able to check server-side if an image was deleted or not (for example, by checking if the Content-Type was image/gif instead of image/jpg, on Flickr images).

The problem is that each page returns 20-100 images on average (sometimes even more), and get_headers() requires on average 0.3-0.5s for each image, thus making the wait time for the user too long.

I was wondering if this check could be done client-side, using javascript. The user will be waiting for the images to load (as with any page), I will be checking the images if they are valid, and set display property to none on the missing ones.

  • 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-01T02:47:41+00:00Added an answer on June 1, 2026 at 2:47 am

    You can use curl_multi_exec() to check multiple URLs at once. If you use the following cURL options:

    CURLOPT_FOLLOWLOCATION = FALSE
    CURLOPT_NOBODY = TRUE
    CURLOPT_HEADER = TRUE
    

    …this will prevent the following of redirects. You can then use this information (whether the response is a redirect or not, see CURLINFO_HTTP_CODE in curl_get_info()) to determine whether the file exists. By using curl_multi_exec() you will perform multiple checks at once, which should drastically reduce the page load time.

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

Sidebar

Related Questions

We have built a web application that accepts SOAP messages, does some processing, calls
I have an application that sends messages to an external web service. I build
I have a web application build in Django + Python that interact with web
I have a web application that was build in c# and uses queries in
I have a web application that allows users to build a 'client list.' We
I have made a build system for my web application that's rewriting all resource
I mantain a custom PHP application (build for me) that is hosted in a
The issue is this: I have a web application that runs on a PHP
I have a PHP web application that needs to call a function in a
I have to build a web application which uses Python, php and MongoDB. Python

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.