Cache Asp.net ne cache pas dans un cas
Allo,
j'ai un site asp.net dans lequel la cache fonctionne à merveille.
J'y ai ajouté une clé de cache supplémentaire, car il me fallait une deuxième version dans la cache.
C'est dans ce cas que la cache ne fonctionne pas.
On me sert toujours une page "fraîche".
Voici ma fonction GetVaryByCustom. J'ai mis en rouge ce que j'ai ajouté qui ne fonctionne pas.
Code:
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 |
Quelqu'un a déjà rencontré un problème similaire?
Merci!