Asp. NET Core Service improvements

Source: Internet
Author: User
Tags microsoft sql server

Permanent redirect page

A common Web application approach is to frequently move Web pages and other content over time, leading to the accumulation of failed links in search engine tutorials. In asp.net, developers usually use the solution to the old Web site request by using the Response.Redirect method to forward requests for the old URLs to the new URLs. However, when a user tries to access an old URL, using the Redirect method results in an "HTTP 302 Found" (temporary redirection) response, resulting in an additional HTTP round-trip.

ASP.net 4 adds a new Redirectpermanent helper method that makes it easy to emit an "HTTP moved Permanently" response, as shown in the following example:

Redirectpermanent ("/newpath/foroldcontent.asp tutorial X");

Search engines and other user agents that identify permanent redirects will store the new URLs associated with this content, eliminating unnecessary HTTP trips due to temporary redirection.

  Highly scalable session-state management

Asp. NET provides two default options for storing session state in a Web farm: A session-state provider that invokes an Out-of-process session state Server , and a session-state provider that can store data in a Microsoft SQL Server database Tutorial. Since both options involve storing state information outside of the Web application's working process, it must be serialized before the session state is sent to remote storage. Depending on how much information the developer holds in the session state, the size of the serialized data may grow to a considerable extent.

ASP.net 4 introduces a new compression option for two out-of-process session state providers. When the compressionenabled configuration option shown in the following example is set to True, ASP. NET will use the System.IO.Compression.GZipStream class of the. NET Framework to compress (decompress) serialized session state.

!--

Code highlighting produced by Actipro Codehighlighter (freeware)
. CODEHIGHLIGHTER.COM/

--> sessionstate
  mode = SQL Server "
  sqlconnectionstring = " data source=dbserver;initial catalog=aspnetstate "
  allowcustomsqldatabase = " true "
  compressionenabled = true
/>

        by simply adding this new attribute to the Web.config file, Web server An application with an idle cpu cycle can achieve a significant reduction in the size of the serialized session state data.

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.