Solved

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

Posted on 2013-11-12
3
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

623 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