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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:19:55+00:00 2026-05-10T20:19:55+00:00

Are you aware of any serious performance problems with checking if a file exists

  • 0

Are you aware of any serious performance problems with checking if a file exists before you open it and send it? The context for this is a web application that serves up files dynamically via an ASP page. I was told that there is no check for whether or not the file exists because the database stores this information and shouldn’t be wrong. It is of course sometimes wrong for any number of reasons so we end up sending back nothing leaving the user unhappy.

My instinct is that checking for a file’s existence is so cheap that you shouldn’t worry about it but I was told otherwise. Our storage solution is a pretty high powered one (not just an IDE drive on the web server) if that helps. My question is basically: Is my instinct correct?

Thanks!

Note: These files are never just deleted. Something has to go wrong for them to be missing but this happens a few times a week. Also, the reason I want to check for a file’s existence is because I can return an alternate asset that is on disk so I’d like to be able to have that logic all in one spot rather than deal with catching an exception and dealing with that in that context.

  • 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. 2026-05-10T20:19:56+00:00Added an answer on May 10, 2026 at 8:19 pm

    Even if you check it exists just before you try to serve it, it could be deleted between the check and you serving it.

    The problem here is that you send back nothing if you can’t serve the file. Trying to serve a non-existent file should throw an exception (or whatever the equivalent is on your platform) – you should handle that exception by returning an appropriate ‘Sorry, we couldn’t find your file’ error page.

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

Sidebar

Related Questions

I am not aware of any application on android that is capable of downloading
Is anyone aware of any open source libraries/implementations of real-time timescale-pitch modification algorithms?
Is anyone aware of any performance implications from changing the _win32_winnt from 0x400 to
Are you aware of any open-source/free .NET profanity filter (ASP.NET MVC to be precise)?
Are you aware of any open source libraries/projects that offer audio watermarking capability?
Are aware of any solution that let me deactivate my facebook account through an
Is anyone aware of any legal precedents where the lack of unit testing in
Is there any way a Jenkins build can be aware of the Maven version
I am aware that MD5 hashes are not advisable for security any more but
I aware that this will be a less programming question, but still... How can

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.