Search code examples
asp.netiispagespeed

How to respect "Serve static content from a cookieless domain" page speed rule in IIS6?


How to respect "Serve static content from a cookieless domain" page speed rule in IIS6?


Solution

  • To create a cookieless site (or subdomain, which is a very common best-practice) in IIS6/IIS7/IIS7.5 is simple : you need to tell the website that you are not to use cookies :) Which means in IIS terms, not to use a session.

    This can be achieved in IIS6/IIS7 via two ways.

    1. Modifying the Web.config file (my personal recommendation)
    2. Using the IIS Manager GUI to find the setting and changing it.

    IMPORTANT

    Before you do any testing, you must must must clear all cookies (or all cookies for the domain u are testing) otherwise, they will get passed along even if u have done all the steps.

    1. Via Config File

    You need to define the session state to off.

    <system.web>
            <sessionState cookieName="What_ever" mode="Off" />
    </system.web>
    

    NOTE: Please note that the attribute cookieless (true|false) does NOT mean 'send cookies/do not sent cookies). That's for using sessions with/without cookies ... and passes some cookie guid into the url instead (if set to true).

    2. Via Gui

    alt text

    alt text

    Hope this Helps (i assume u know how to test that no cookies are working/not working...)