Click here to Skip to main content
15,886,799 members
Articles / Web Development / ASP.NET

Caching WCF javascript proxy on browser

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
4 Apr 2012CPOL3 min read 40.3K   236   17  
WCF Javascript Proxies (Service.svc/js) are never cached. They get generated and downloaded on every page view thus increasing page download time and server CPU. Here's an HttpModule to cache WCF Javascript Proxy on browser and respond with HTTP 304, if unchanged.

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WcfService1", "WcfService1\WcfService1.csproj", "{82030C51-136B-4B72-AAC0-6B568D10A2FD}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{82030C51-136B-4B72-AAC0-6B568D10A2FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{82030C51-136B-4B72-AAC0-6B568D10A2FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{82030C51-136B-4B72-AAC0-6B568D10A2FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{82030C51-136B-4B72-AAC0-6B568D10A2FD}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect BT, UK (ex British Telecom)
United Kingdom United Kingdom

Comments and Discussions