1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <Microsoft.SharePoint.Security.SharePointPermission(System.Security.Permissions.SecurityAction.LinkDemand, ObjectModel:=True)> _
Public Overloads Function GetVaryByCustomString(ByVal app As HttpApplication, ByVal context As HttpContext, ByVal custom As String) As String Implements IVaryByCustomHandler.GetVaryByCustomString
Dim cacheKey As New StringBuilder
' Group
If custom.Contains(GROUP_CODE) AndAlso _
Not String.IsNullOrEmpty(ServiceContexteSharepoint.Groupe) Then
cacheKey.Append(ServiceContexteSharepoint.Groupe)
End If
' Province
If custom.Contains(PROVINCE_CODE) AndAlso _
Not String.IsNullOrEmpty(ServiceContexteSharepoint.Region) Then
cacheKey.Append(ServiceContexteSharepoint.Region)
End If
' Ajout à la clé d'un flag pour différencier les pages des crawler (Sans ajout du Tag WebResource.axd par asp.net)
' Case SRX080814601934
Dim version As System.Version = app.Context.Request.Browser.EcmaScriptVersion
If version Is Nothing OrElse version.Major < 1 Then
cacheKey.Append("_SansJavascript")
End If
cacheKey.Append(app.Request.Url.Host)
If ReferrerEstEnginRecherche() Then
cacheKey.Append("_EnginRecherche")
End If
Return cacheKey.ToString
End Function |
Partager