asp.net 4.0 core runtime enhancements

19
Interoperability with Microsoft Technologies ASP.Net 4.0 Core runtime enhancements Sundararajan Subramanian Associate Technical Architect | Aditi Technologies Ltd., http://tinyurl.com/codeshelve | [email protected]

Upload: byrd

Post on 07-Feb-2016

42 views

Category:

Documents


0 download

DESCRIPTION

ASP.Net 4.0 Core runtime enhancements. Sundararajan Subramanian Associate Technical Architect | Aditi Technologies Ltd., http://tinyurl.com/codeshelve | [email protected]. Asp.Net Resource Monitoring. Traditionally monitored at worker process level - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

ASP.Net 4.0Core runtime enhancements

Sundararajan SubramanianAssociate Technical Architect | Aditi Technologies Ltd.,http://tinyurl.com/codeshelve | [email protected]

Page 2: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Asp.Net Resource MonitoringTraditionally monitored at worker process level

No insight into the individual applications sharing the same worker process.

CLR 4 introduces ARM – Application domain resource management

Enables monitoring resources at individual appdomain level

Page 3: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Asp.Net Resource MonitoringASP.NET 4 exposes performance counters built on ARM

Managed Memory Used % Managed Processor Time

Page 4: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Asp.Net Resource Monitoring• Enable ARM in aspnet.config file in the

.Net framework directory<?xml version="1.0" encoding="UTF-8" ?> <configuration> <runtime> <appDomainResourceMonitoring enabled="true"/> </runtime> </configuration>

Page 5: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Resource Monitoring

DEMO

Page 6: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Extensible Request Validation

Write your own custom Request ValidatorsStep1: Inherit from System.Web.Util.RequestValidatorStep2: Override IsValidRequestString(….)Step3: configure custom request validator in web.config<httpRuntime requestValidationType="Samples.MyValidator, Samples" />

Page 7: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Request Validation

DEMO

Page 8: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Session StateOut-Of-Proc Session State CompressionCompressed using GZIP - System.IO.Compression.GZipStream

<sessionState mode="SqlServer" sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate" allowCustomSqlDatabase="true" compressionEnabled="true" />

Page 9: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Auto start Web applicationsIntensive operations to be performed when application starts?First request takes time?Asp.Net 4 + IIS 7.5 + Windows 2008 R2 – Configure Autostart Web apps

Page 10: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

<applicationpools> <add name="defaultappPool" startMode="AlwaysRunning" /></applicationpools>

<sites> <site name="MySite" id="1"> <application path="/" serviceAutoStartEnabled="true" serviceAutoStartProvider="PrewarmMyCache" > <!-- Additional content --> </application> </site>

</sites>

<!-- Additional content -->

<serviceautostartproviders> <add name="PrewarmMyCache" type="MyNamespace.CustomInitialization, MyLibrary" /></serviceautostartproviders>

Page 11: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Output CachingCache the response (output) in memory previouslyHigh memory footprint in case of applications with heavy trafficAsp.Net 4.0 provides features to write custom output cache providersCan use any storage mechanism to store HTML content

Page 12: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Output cacheCreate Custom output cache provider by inheriting from System.Web.Caching.OutputCacheProviderConfigure the provider in the providers section of the web.config

Page 13: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Output Caching

DEMO

Page 14: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

URL limitPreviously 260 character limit.Extend this character limit in Asp.net 4.0 by config<httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" /> requestPathInvalidChars - Configure the set of valid characters in the url<httpRuntime requestPathInvalidChars="&lt;,&gt;,*,%,&amp;,:,\,?" />

Page 15: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Other featuresCustom Encoders

encoderType in <httpruntime> elementObject caching

Features of Asp.Net cache brought to other non web applications

RedirectPermanent(..) – HTTP 301

Page 16: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

ReferencesAsp.Nethttp://www.asp.net/

Page 17: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Feedback / QnAYour Feedback is Important!Please take a few moments to fill out our

online feedback form

Use the Question Manager on LiveMeeting to ask your questions now!

Page 18: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies

Contact (optional slide)Code snippets bloghttp://tinyurl.com/codeshelve

http://sundars.netEmail [email protected]

Twitter - @sundararajans

Page 19: ASP.Net  4.0 Core runtime enhancements

Interoperabi l i ty w ith Microsoft Technologies