Click here to Skip to main content
12,450,581 members (49,944 online)
Click here to Skip to main content

Tagged as

Stats

26.9K views
218 downloads
17 bookmarked
Posted

Caching WCF javascript proxy on browser

, 4 Apr 2012 CPOL
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.
WcfJavascriptProxyCaching
WcfJavascriptProxyCaching.suo
WcfService1
App_Data
bin
WcfService1.dll
WcfService1.pdb
Global.asax
obj
Debug
DesignTimeResolveAssemblyReferencesInput.cache
TempPE
WcfService1.dll
WcfService1.pdb
Properties
Service1.svc
WcfService1.csproj.user
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace WcfService1
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {

        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}

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)

Share

About the Author


You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 4 Apr 2012
Article Copyright 2012 by Omar Al Zabir
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid