how to prevent aspx pages from being stored in internet temporary file's folder.

Posted on 2005-04-06
Last Modified: 2010-04-07
We have an web application so when the user requests pages from our server
the pages are stored in the temporary folder on the client machine also the js files are stored
on the client's machine + images.

How can we stop that using code behind files or html meta tags.
I don't want the pages,images and js files to be stored on user's computer.

I want nothing on the client's machine.

Question by:LorneBackler
    LVL 25

    Expert Comment

    Well, if to get a new data any time user visit the web page you can append a random number in the URL.  Will it work?

    LVL 15

    Expert Comment

    Response.Expires=0; try that
    LVL 44

    Expert Comment

    why are you holding the code-behind files on the server?  What should be in the /bin folder on the server are the .aspx files and the .dlls of the app, and NOTHING else.

    and how is the user saving copies of your app files on their computer?  I have never heard of this setup before.


    Author Comment

    Yes but we don't have .vb files on the server while developing the application you write code in the class files and

    then render into dlls.

    So while developing the application what should i write on page load event to say that when the code is executed
    on the server and the html is returned back to user that html i don't want it to be stored on the client machine instead
    after the user sees the page and kills the page i want that html source code to be destroyed.

    Basically clear cache...

    LVL 1

    Expert Comment

    As praneetha suggested you can set the page that is being stuck into cache to expire immediately, but beyond that I dont think that you can do anything else. The info has to be transmitted for the client to display it. The way that browsers work they display the version they just pulled into tmp. once they are there you cant do anything about them as they are outside the sandbox. So my advice is set for immediate expiration, and since there isnt anything hitting the client you arent sending, there shouldnt be anything highly sensitive anyway. I hope it clarifies things.
    LVL 5

    Expert Comment

    I'm not sure why you want to "destroy" client side code when it's been shown, but if the reason is to avoid people steal your client scripts - just forget it. It cannot be done (there are lot of ways to make it harder, but nothing "safe").

    If the reason is to prevent client side caching, there are some simple tasks to accomplish this. The one Microsoft recommends is the way that people here suggested (response.expires=0) maybe combined with some meta-tags in your html file. Personally I think this way often isn't completly reliable. A better approach to me, even though it puts a lot of entries in the client machine's "history", is to assure that your files querystring is unique.

    LVL 25

    Accepted Solution

    If you have access to the IIS, you can also force the content expiration

    IIS Manager -> Web Site Properties -> HTTP Headers -> Enable Content Expiration -> Expire Immidiately

    That way you will be safe :)

    HTH, Nauman.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now