My problem is about caching of WebResource.axd requests.
In the begining, every responses of WebResource.axd requests have caching header and there is no problem.The problem is begin when I press Ctrl+F5 or make a request after clearing browser cache history. That cause no cache header for WebResource.axd requests
for unknown time ??!!! (it's tested on Chrome and Firefox)
I've created a simple HttpModule that add cache header and create a log for WebResource.axd requsets:
I realized that this module is in request pipline just before the start of problem. I mean after press Ctrl+F5 , this module is not run in requets pipline (no log entry in problem)
When you press CTRL+F5 browser send a new request to the server, data will not load from the browser cache, so it will not work when you press CTRL + F5,
let me know if any query
Thanks,
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
Marked as answer by Angie xu - MSFT on Jan 24, 2013 12:07 AM
When I press Ctrl+F5 something strang happen in my web server:
1- IIS worker process does not get invloved for the WebResource.axd requests ( because my simple HttpHandled does not run any more)
I realized that this situation still remain till recycleing of the IIS worker process. After I recycle worker process, then asp.net get involved in requst handeling and cache header in response again is added too.
I Do Not know whay pressing Ctrl+F5 cause this situastion in my web server.
Is there any configuraion mistake ?
My web server is on windows 2012 (x64 ofcurse) but I have set 'Enable 32bit Applications' in IIS worker process (because in default mode the memory usage of the worker process goes very high. !!!!! I dont know why)
Is there any problem in my precompilation and publishing of my web site?
I think dhol.gaurav's explanation is available for you.
At the same time it is necessary for you to learn the mechaniam of web resources work,
When a request comes in from the client for WebResource.axd, the handler looks for the Web Resource identifier in the QueryString method of the Request object. Based on the value of the Web Resource identifier, the handler then tries to
load the assembly that contains this resource. If this operation is successful, the handler will then look for the assembly attribute and load the resource stream from the assembly. Finally, the handler will grab the data from the resource stream and send
it to the client together with the content type that you specify in the assembly attribute.
reza.sorouri
Member
4 Points
25 Posts
WebResource.axd strange behavior
Jan 15, 2013 10:16 PM|LINK
Hi
Please some one help me. I'm getting creazy!!!!
My problem is about caching of WebResource.axd requests.
In the begining, every responses of WebResource.axd requests have caching header and there is no problem.The problem is begin when I press Ctrl+F5 or make a request after clearing browser cache history. That cause no cache header for WebResource.axd requests for unknown time ??!!! (it's tested on Chrome and Firefox)
I've created a simple HttpModule that add cache header and create a log for WebResource.axd requsets:
void httpApp_PostRequestHandlerExecute(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
HttpContext context = app.Context;
string req = context.Request.Url.LocalPath.ToLower();
if (req.IndexOf("webresource.axd") != -1 || req.IndexOf("scriptresource.axd") != -1)
{
Tools.Log log = new Log("webresource");
log.Add_Log(req);
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetExpires(DateTime.Now.AddYears(1));
}
}
I realized that this module is in request pipline just before the start of problem. I mean after press Ctrl+F5 , this module is not run in requets pipline (no log entry in problem)
Please tell me what is my problem
Thank you very very much for your reply
dhol.gaurav
Contributor
4140 Points
751 Posts
Re: WebResource.axd strange behavior
Jan 16, 2013 07:25 AM|LINK
Hi,
When you press CTRL+F5 browser send a new request to the server, data will not load from the browser cache, so it will not work when you press CTRL + F5,
let me know if any query
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
reza.sorouri
Member
4 Points
25 Posts
Re: WebResource.axd strange behavior
Jan 16, 2013 07:52 AM|LINK
Hi,
When I press Ctrl+F5 something strang happen in my web server:
1- IIS worker process does not get invloved for the WebResource.axd requests ( because my simple HttpHandled does not run any more)
I realized that this situation still remain till recycleing of the IIS worker process. After I recycle worker process, then asp.net get involved in requst handeling and cache header in response again is added too.
I Do Not know whay pressing Ctrl+F5 cause this situastion in my web server.
Is there any configuraion mistake ?
My web server is on windows 2012 (x64 ofcurse) but I have set 'Enable 32bit Applications' in IIS worker process (because in default mode the memory usage of the worker process goes very high. !!!!! I dont know why)
Is there any problem in my precompilation and publishing of my web site?
should I consider any thing for x64 web server?
Thank you
Angie xu - M...
All-Star
20240 Points
1717 Posts
Microsoft
Re: WebResource.axd strange behavior
Jan 22, 2013 10:12 AM|LINK
Hi reza.sorouri
I think dhol.gaurav's explanation is available for you.
At the same time it is necessary for you to learn the mechaniam of web resources work,
When a request comes in from the client for WebResource.axd, the handler looks for the Web Resource identifier in the QueryString method of the Request object. Based on the value of the Web Resource identifier, the handler then tries to load the assembly that contains this resource. If this operation is successful, the handler will then look for the assembly attribute and load the resource stream from the assembly. Finally, the handler will grab the data from the resource stream and send it to the client together with the content type that you specify in the assembly attribute.
For reference - http://support.microsoft.com/kb/910442
hope it helps you,
Kind regards
Feedback to us
Develop and promote your apps in Windows Store