Asp.net page cache learning Summary

Source: Internet
Author: User

I encountered a problem a few days ago and was puzzled. Later, I checked some materials and found some ideas. Record your problems and hope to help other garden friends.

Helper house www.bkjia.com

This is the case. My asp.net page was not updated when I accessed it again using window. open navigation. Specifically, I did not access the server when I accessed it again. However, this problem does not occur on my machine, and other machines in the project team have this problem. At that time, I was so depressed that it was not convenient to debug. At last, I output a lot of alert on the page. After several tests, I found the problem.

The main problem is that the page is cached by ie. When the server is updated, ie does not check the page. My machine is okay because I set ieto check for updates every time I access the page, and they automatically check for updates. Because I used the front-end window. open Method to navigate to the page again, this method cannot make the browser's automatic check take effect.

The description above is messy. I wonder if you can understand it. Let me explain the specific solution.

Method 1: Use the Response. Redirect method on the server or the window. location. replace method on the front-end for navigation.

Method 2: Disable page caching.

I recommend method 2 when necessary. Because the browser settings cannot be controlled during development. If you set Internet Explorer to never check and update the cache, it is difficult to avoid this problem. Therefore, use method 2 to make the Temporary Folder of Internet Explorer non-existent page files.

In addition, whether to disable the page cache depends on the actual situation. At first I thought that the page cache was only cached on the server, and then I read a blog

The significance of cache is large. In many cases, the pressure on the server can be greatly reduced. However, in the development process, we need to focus more on the needs and do not blindly set any attributes.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.