Scalability of System.IO.File.Exists

Discussion in 'ASP .Net' started by Brian, Apr 11, 2006.

  1. Brian

    Brian Guest

    I have an ASP.NET 1.1 app that rewrites URL's. Rewriting a path to an
    ..aspx file that does not exist throws a nasty server-500 exception, not
    a 404. One thought I had was to Server.MapPath the URL I'm about to
    pass to Context.RewritePath and check it with System.IO.File.Exists. My
    concern is the expense of touching the filesystem like this for each
    and every request I get - is this a bad idea?

    A similar question I have is forcing client-reloads of .css, .js, &
    image files that have changed since the last time a client visited our
    site. In a previous life we wrapped URL's like these in an object that
    appended the timestamp from the file:

    ....src="path/styles.css"...

    Would result in

    ....src="path/styles.css?200604101442"...

    Where the text after the ? was the file's timestamp and would be enough
    to cause the browser to fetch it over the wire instead of use its
    cache. But again, I'd be touching the filesystem _a lot_ to get this
    information - will that scale? Or, is there a better way to do this?

    Thanks everyone!

    -Brian
    Brian, Apr 11, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chad Crowder
    Replies:
    7
    Views:
    21,534
    hemant.yadav
    Oct 24, 2009
  2. Totan
    Replies:
    0
    Views:
    937
    Totan
    Apr 17, 2006
  3. Max
    Replies:
    4
    Views:
    10,923
    Kevin Spencer
    Aug 11, 2006
  4. Tony Bansten
    Replies:
    1
    Views:
    283
    Walter Roberson
    Aug 4, 2005
  5. Ulf Meinhardt
    Replies:
    8
    Views:
    6,141
Loading...

Share This Page