You create the custom function in the Global.asax file by overriding the GetVaryByCustomString() method.
File: Global.asax
<%@ Application Language="C#" %>
File: Default.aspx
<%@ Page Language="C#" %>
<%@ OutputCache Duration="3600" VaryByParam="none" VaryByCustom="css" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Vary By Custom