mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
@@ -515,14 +515,7 @@ namespace Orchard.OutputCache.Filters {
|
||||
}
|
||||
|
||||
private string ComputeCacheKey(ControllerContext controllerContext, IEnumerable<KeyValuePair<string, object>> parameters) {
|
||||
var url = controllerContext.HttpContext.Request.RawUrl;
|
||||
if (!VirtualPathUtility.IsAbsolute(url)) {
|
||||
var applicationRoot = new UrlHelper(controllerContext.HttpContext.Request.RequestContext).MakeAbsolute("/");
|
||||
if (url.StartsWith(applicationRoot, StringComparison.OrdinalIgnoreCase)) {
|
||||
url = "~/" + url.Substring(applicationRoot.Length);
|
||||
url = VirtualPathUtility.ToAbsolute(url);
|
||||
}
|
||||
}
|
||||
var url = controllerContext.HttpContext.Request.Url.AbsolutePath;
|
||||
return ComputeCacheKey(_shellSettings.Name, url, () => _workContext.CurrentCulture, _themeManager.GetRequestTheme(controllerContext.RequestContext).Id, parameters);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">@T("Url")</th>
|
||||
<th scope="col">@T("Cache Key")</th>
|
||||
<th scope="col">@T("Cached On")</th>
|
||||
<th scope="col">@T("Cached Until")</th>
|
||||
<th scope="col"> </th>
|
||||
@@ -23,6 +24,7 @@
|
||||
@foreach (var cacheItem in Model.CacheItems) {
|
||||
<tr>
|
||||
<td><span title="@cacheItem.QueryString">@cacheItem.Url</span></td>
|
||||
<td>@cacheItem.CacheKey</td>
|
||||
<td>@Display.DateTimeRelative(DateTimeUtc: cacheItem.CachedOnUtc)</td>
|
||||
<td>@cacheItem.ValidUntilUtc.ToLocalTime()</td>
|
||||
<td>@Html.ActionLink(T("Evict").Text, "Evict", new { Area = "Orchard.OutputCache", Controller = "Statistics", cacheKey = cacheItem.CacheKey })</td>
|
||||
|
||||
Reference in New Issue
Block a user