Possible To Cache The Response Of A Http Handler On The Server And On The Client

Mar 11, 2010

Is it possible to cache the response of a http handler on the server and on the client?This doesn't seem to be doing the trick:

_context.Response.Cache.SetCacheability(HttpCacheability.Public);
_context.Response.Cache.SetExpires(DateTime.Now.AddDays(7));

View 2 Replies


Similar Messages:

Http - FireFox 3.6.8 Not Cache Static Contents From .net Developer Server?

Aug 19, 2010

I am working on a asp.net web site, like normal user, we use asp.net developer server during coding and testing.Today, I found the firefox not cache any static file of my site, since our application is pretty big, it made page load time very slow.I checked firefox about:cache, all the static file cache setting looks like

Key: http://localhost:26851/App_Layout/icons/actions/email/folder.png
Data size: 871 bytes
Fetch count: 1[code]...

The expires date is set back to 1969-12-31, I believe that's the reason why they are loaded very time.I am using Visual studio 2008, windows 7 machine. The application works fine in IE, the contents are properly cached.

View 5 Replies

How To Call Static File Handler From HTTP Handler In IIS7 And 4.0

Jan 24, 2011

I create custom HTTP handler for auto generating file and I want to tell IIS7 to serve current request like normal static file because I need to use IIS and web.config file to control compression setting and any other HTTP header of current requested file.I know. there is an internal class called StaticFileHandler in ASP.net. But I cannot access it. Or you have any other way to work like this.

View 1 Replies

Architecture :: Cache The Full List Of Objects In Http Cache On The Service Tier And Page In Memory?

Feb 25, 2011

We have a wfc layer that wraps the business classes and database access and use a client that lives on the database layer. Amongst our group we are attempting to form standards. Some want to have the client call the web method and pass the page they are requesting and the page size. Pass that to the database and then page in SQL Server use RowNum.Some want to cache the full list of objects in http cache on the service tier and page in memory. They concern here is memory use on the server.

Which would be best for a medium number of users with potentially large number of records to manage (say 30K) Is it better to cache them all in memory and work from there or page at the database as the application scales?

View 1 Replies

HttpHandlers / Modules :: Redirect A Page From Http To Https Using Http Module Begin Request Handler?

Jul 15, 2010

i redirect a page from http to https using http module begin request handler .i am calling webservice using ajax but it is saying webserice not defined .which otherwise works fineits work fine when rediect page in page_load instead .but i need to add function for https to http in every page. i still not know why ajax is not working when i use http module for redirect

View 3 Replies

C# - Can Get The Message/response Body In WCF When Server Returns An HTTP 401

Jan 12, 2010

I have a WCF client test harness where I'm using a "client message inspector" endpoint behavior to "pick off" raw requests and response messages going to and from a service and save them for later display in the UI.

This works great, except for the use case where invalid credentials are passed (Basic Authentication). The server returns an HTTP 401 along with a SOAP fault in the body containing details of what happened. I have no control over the service, so this behavior cannot be changed.

Because the HTTP 401 is returned as a WebException, my message inspector never fires and I can't get to the raw response. This exception eventually gets to the UI in the form a MessageSecurityException.

Is there any way to suppress this so the message inspector's AfterReceiveReply still fires? or is there somewhere else I can access the entire raw response?

View 1 Replies

HttpHandlers / Modules :: Automating An Http Handler / Filesystemwatcher To Post An Xml Document To Another Server (with No Human Interaction)?

Jul 20, 2010

This is kind of cross-post; however, can a custom http handler be automated to run either using a timer or a filesystemwatcher to post an xml document to another server (with no human interaction)?

View 2 Replies

How To Pass Through Http Call With HTTP Handler

Jan 4, 2011

Background:

We are using the Facebook API and receive back URLs for profile image thumbnails. Unfortunately the protocol is restricted to just HTTP and it doesn't support HTTPS. The page on our site that hosts the thumbnails is always delivered via HTTPS, and if we use HTTP for the thumbnails the user will receive security warnings from their browser.

Solution:

Build an HTTP Handler that "passes through" the image from the Facebook URL, but allow the handler to be called via HTTPS. Before I started coding I thought I could something like this:

Response.OutputStream = WebRequest.Create(FacebookUrlForThumbnail)

but I ended up having to save the image to an object in memory than write the image to the Response.OutputStream using the image save function.

Current Code:

[Code]....

This seems inefficient but I can't find a way of using the HTTP Handler as I orginally intended. Is there way of accomplishing the goal without creating the image memory and just "passing through" the call?

View 3 Replies

Cache Stores Values On The Memory Of The Client Or On The Server?

Mar 30, 2010

NET Cache stores values on the memory of the client or on the server?If it stores on the memory of the client then can i store the values in Cache instead of cookies - as this will improve speed of my application

View 4 Replies

How To Force Client Browser To Download Images From Server Rather Using Its Cache

May 20, 2010

Assume a simple aspx data entry page in which admin user can upload an image as well as some other data. They are stored in database and the next time admin visits that page to edit record, image data fetched and a preview generated and saved to disk (using GDI+) and the preview is shown in an image control.

This procedure works fine for the first time however if the image changes (a new one uploaded) the next time the page is surfed it shows previously uploaded image. I debugged the application and everything works correct. The new image data is in database and new preview is stored in Temp location however the page shows previous one. If I refresh the page it shows the new image preview. I should mention that preview is always saved to disk with one name (id of each record as the name).

I think that is because of IE and other browsers use client cache instead of loading images each time a page is surfed. I wonder if there is a way to force the client browser to refresh itself so the newly uploaded image is shown without user intervention.

View 2 Replies

C# - HTTP 502 Proxy Error - The Size Of The Response Header Is Too Large. Contact Your ISA Server Administrator. (12216)

Feb 23, 2011

Some of my users are getting the following error

HTTP 502 Proxy Error - The size of the response header is too large. Contact your ISA server administrator. (12216) Internet Security and Acceleration Server

I am guessing it has to do with the size of hidden "__ViewState" tag in my ASP.NET pages.

I also realize that this is restriction imposed to by IT on the users end and I have no contol over it.

I disabled ViewState on all the controls in my ASP.NET pages. However, __ViewState is still generated very large (as always) to persist control-state (e.g. checkbox, radiobutton, etc.)

View 2 Replies

What Is HTTP Module And HTTP Handler

Jan 20, 2010

clear my concept What is HTTP module and HTTP Handler and how does they work while page requesting???

How authentication and Authorization process work in asp.net?

View 2 Replies

AJAX :: How To Upload A File From Server To Client Without Attaching It To The Response

Mar 22, 2011

Basically I have to generate a rather large XPS document serverside and send this back to the client.

The issue I have whilst trying to do this is because the XPS document needs to be created on a STA thread, so either the response is sent back before the async operation is complete (in which case I can't attach the file using the transferfile method) OR I have to wait until the Async thread has completed and then I can send the file using the transferfile method (but this leaves the current page locked out for quite a while).

View 5 Replies

Web Forms :: Client Download .csv File From Server Using Response.TransmitFile?

Sep 3, 2010

I am using the code below to enable clients to download a .csv file from my server.

The problem I am having is that when the file is saved to the client computer the file name is prefixed and suffixed with an underscore which leads to a file type of .csv_ which is obviously not a recognised file type.

How can I strip the underscores from the file name at the transmit stage?

Dim FileName As String = LstBox1.SelectedItem.ToString
Dim FilePath As String = "~/temp" & FileName
Response.Clear()
Response.ContentType = "text/csv"
Response.AddHeader("Content-Disposition", "attachment; filename=" & FileName & "")
Response.TransmitFile(FilePath)
Response.End()

View 9 Replies

Response.Cookie Client Or Server/where Does The Cookie Saved? On Client Machine Or Server Machine?

Mar 7, 2011

When calling Response.Cookie.Add(new HttpCookie("MyCookie", "objValue")); where does the cookie saved? on Client Machine or Server Machine?

EDIT:if saved in Client Machine, how can I read it from javascript then? I tried this kind of script.

function getCookie(c_name) {
var i, x, y, ARRcookies = document.cookie.split(";");
for (i = 0; i < ARRcookies.length; i++) {
[code].....

I cannot get the cookie that I saved from code behind. When I look into the document.cookie object, it is just an empty string.

Scenario:On Page_Init() on code behind. I create a cookie using Response.Cookie.Add(new HttpCookie("MyCookie", "cookieValue"));.
On Client side, I'm trying to read the cookie saved from code behind on page load using the snippet above, but it returns undefined

View 3 Replies

Custom Server Controls :: How To Programmatically Cache A Server Control And Add A Cache Dependency?

Feb 11, 2011

I have a server control that I developed which generates navigation based on a third party CMS API. Currently I am caching this control using the PartialCaching attribute. The CMS uses cache key dependencies to invalidate the cache when a user makes an edit, however in the case of my server control it does not get invalidated and the updated navigation will not show up until the cache expiration set by the PartialCaching attribute.Here is my two part question:

What is the proper way to programmatically cache a server control, without using the PartialCaching attribute, and adding a cache key dependency?

Is it possible to continue to use the PartialCaching attribute and add a cache key dependency?

View 2 Replies

Trying To Write An HTTP GET Handler?

Mar 24, 2011

I'm trying to write an HTTP GET handler. The path should start with http://site/processTask and have a set of URL-encoded parameters. I have the following in my web.config

<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add verb="GET" path="processTask*" type="MyHandler.ProcessTaskHandler, MyHandler"/>
</httpHandlers>

now when I type the URL http://mysite/processTask in browser I get HTTP 404 but if I change the add verb line to the following one:

<add verb="GET" path="processTask.asmx*" type="MyHandler.ProcessTaskHandler, MyHandler"/>
and type http://mysite/ProcessTask.asmx in browser the handler is run and I get the response from the handler. What's the problem? Why is the handler run only when the path contains .asmx? How do I change web.config so that .asmx is not required?

View 1 Replies

C# - How To Configure An Http Handler In IIS 7

Nov 24, 2010

Here's what I want to do:

I've created a class library project
and this has a class implementing
the IHttpHandler interface. Let's
call this class ZipHandler. Let's
say the namespace is Zip.
I want that whenever any Http
request comes for a zip file, my
ZipHandler should handle it,
regardless of whether the request is
to an Asp.Net application or a
normal virtual directory.

Queries:

Is it possible (it should be given
the hype about integrated pipeline
etc. in IIS 7)?
How to do it?

View 2 Replies

HTTP Handler Method For Images

Jul 10, 2010

I am new to this topic. SO please look over my stupid mistakes. I have web application and its virtual directory path is as followshtpp://localhost/TxtXmlImggHandler/This root has three pages one for text, one for xml, one for images. Actually these pages call three different handlers. I had no problem when I send/receive some data to HTTPHandler for processing, had no problem when I request xml file from HTTPHandler.Now I am trying to get image from HTTPHandler, but no luck. All my HTTPHandlers are sitting in root of my web application

View 3 Replies

C# - Http-handler Load Error?

Jan 30, 2010

I successfully added and configured HttpHandler in an Asp.Net WebApplication, but facing problems while trying to add same HttpHandler to Asp.Net WebSite. I have registered it in the web.config, am i missing something This is the error I am getting Configuration Error

Description:

An error occurred during the processing of a configuration file required to service this request.
Parser Error Message: Could not load type 'MyHandler'.

Line 98: </pages>
Line 99: <httpHandlers>
Line 100: <add verb="*" path="*.result" type="MyHandler"/>
Line 101: <remove verb="*" path="*.asmx"/>

Here is handler

public class MyHandler: IHttpHandler
{
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
}
#endregion
}

NOTE: I have not made any request for the handler via url, it is just not letting me run application.

View 2 Replies

Chart Control Needs An HTTP Handler?

Nov 25, 2010

I have an VS2010 ASP.NET 4 web site app, to which I added the new Chart control.

When I deployed it to our web server, we get a" Internal Server Error 500." message.

I noticed that the following lines were added to the web.config since the last release, related to the chart control:

<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false" />
</httpHandlers>

If I remove this added code from the web.config, the site works--Except for the charting functionality.

How do I get the site and the chart page to work?

This is not an issue on IIS versions < 7.

View 2 Replies

HTTP POST, Redirect To JSP/ColdFusion,best Server Side Or Client Side?

Jan 25, 2010

I want to post data to another server (JSP or ColdFusion).

Note:Post which means the data is required at the another server also the browser should be redirected automatically.Is it better to use form tag...input type hidden fields, values...

and from javascript

form.submit();

[code]...

I should use WebClient class?Please provide the points from Security view also.

View 1 Replies

Loading Image From Database Using Http-handler?

Feb 11, 2010

In my MSSQL Server I have a table named Nomogram including an attribute named Img1 which include an image of type varbinary(MAX)I wish to load that image on my webform using an http-handler (ashx).How do I do that? I have looked at this sample but I can figure it out how to solve my exact problem. [URL]

View 29 Replies

Bypass Existing HttpModule For A Http Handler?

Aug 11, 2010

Scenario: I have a bunch of web applications for which I want to add a simple ping functionality via http handler. Example: [URL]

Problem: For some of the applications this approach does not work becasue of custom HttpModule. These modules have some depedency on either authentication or some other processing logic due to which it makes the request invalid.

I am trying to find a solution to get this ping functionality work without making any changes to existing HttpModules.

View 2 Replies

Output Caching In HTTP Handler And SetValidUntilExpires?

Jun 8, 2010

I'm using output caching in my custom HTTP handler in the following way:

public void ProcessRequest(HttpContext context)
{
TimeSpan freshness = new TimeSpan(0, 0, 0, 60);
context.Response.Cache.SetExpires(DateTime.Now.Add(freshness));
context.Response.Cache.SetMaxAge(freshness);
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetValidUntilExpires(true);
...
}

It works, but the problem is that refreshing the page with F5 leads to page regeneration (instead of cache usage) despite of the last codeline:

context.Response.Cache.SetValidUntilExpires(true);

UPD: Seems like the cause of problem is that HTTP handler response isn't caching on server. The following code works well for web-form, but not for handler:

Response.Cache.SetCacheability(HttpCacheability.Server);

Are there some specifics of the caching the http handler response on server?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved