Solved

.Net Help needed to remove Cookie and header information from Static files (js/css/images)

Posted on 2013-11-12
3
234 Views
Last Modified: 2014-03-03
I have a web application which passes cookie and other information in header. This information is also added to static files which i need to remove.

As part of Yslow recommendations additional header information including cookies should be removed from static files.

I know this is possible to achieve by creating a cookieless sub domain and rendering the static files from there. But this is not feasible solution for my application and client.

Please advise
0
Comment
Question by:samlitu
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39643779
Then you can't 'remove' cookies.  Cookies that are set on your domain are Always passed back in every request to that domain.  That is part of how browsers make requests for not just pages but images, css files, and javascript files, everything that comes from that domain.  That is why the recommendation is to use a 'cookie-less' subdomain.

But if you can't do it, don't worry about it.  It's not going to be a huge slow down for your pages.  Some of Yahoo's and Google's 'recommendations' can only be used by sites that control their own servers and have lot of resources.  A lot of the recommendations can't be followed on shared hosting because you don't have control of the server.
0
 

Author Comment

by:samlitu
ID: 39643802
Thanks Dave. Will writing httpmodule and handling cookies would help? I am not sure if this would add to page load time as i need to parse the file type and remove cookie and header information.

Any other thoughts..?
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 39643836
You can't remove any cookies that have been set in the browser.  It's simply not your choice.  Once the cookies have been set like for ASP Sessions and applications, the browser will continue to send them with HTTP requests until they expire.  See here about cookies: http://en.wikipedia.org/wiki/HTTP_cookie#Setting_a_cookie

And the interaction between client browsers and the web server is done by the browser sending a Request header and the server replying with a Response header and the content.  If you were actually able to remove all header information, your web site would stop working.  This page describe the headers that a browser may send with a request: http://en.wikipedia.org/wiki/List_of_HTTP_header_fields  Note that NONE of those are under your control.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction (All good things must come to an end (http://en.wikipedia.org/wiki/All_Good_Things...))The original MySQL API (http://php.net/manual/en/book.mysql.php) has gone away, deprecated by PHP in Version 5.5, and removed from PHP in all current…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question