+2 votes
in Web & Google by (71.8k points)
I tested my webpage using Pingdom Website Speed Test tool. All parameters got rating'A', but 'Serve static content from a cookieless domain' got 'B'. I am serving all the contents from a subdomain which is hosted on different server. I am using Apache webserver. How can I setup a cookieless domain?

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

As your subdomain is hosted on a different server, there are a couple of things you can do.

If you have root access, you can add the followings to empty.conf file in your Apache /usr/local/apache/conf.d folder.

RequestHeader unset Cookie

Header unset Cookie

Header unset Set-Cookie

Header unset Pragma

Header unset ETag

FileETag None

If you do not have root access, you need to modify your .htaccess file.

<FilesMatch "\.(js|css|jpg|png|jpeg|gif|xml|json|txt|pdf|mov|avi|otf|woff|ico|swf)$">
	RequestHeader unset Cookie
	Header unset Cookie
  	Header unset Set-Cookie
</FilesMatch>
Header unset Pragma
FileETag None 
Header unset ETag

...