Skip to content

Commit

Permalink
Last-Modifiedを吐くようにした。
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuki committed Apr 21, 2012
1 parent b3478dc commit 0298a3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion App_Data/Blosxom/Blosxom.cshtml
Expand Up @@ -75,6 +75,7 @@
var entriesDir = Path.Combine(Server.MapPath(dataRootDirectory), "Entries");
var entries = Directory.GetFiles(entriesDir, "*.txt", SearchOption.AllDirectories)
.Select(x => CreateEntryFromPath(entriesDir, x))
.OrderByDescending(x => x.CreatedAt)
.ToList();
Cache.Remove(cacheKey);
Cache.Add(cacheKey,
Expand Down Expand Up @@ -118,7 +119,7 @@
flavour = "feed";
}

IEnumerable<Entry> entries = GetEntries(dataRootDirectory, config.CacheDuration).OrderByDescending(x => x.CreatedAt);
IEnumerable<Entry> entries = GetEntries(dataRootDirectory, config.CacheDuration);

if (!String.IsNullOrWhiteSpace(requestFilterPath))
{
Expand Down Expand Up @@ -162,6 +163,9 @@
return;
}

// Last-Modified
Response.Headers.Add("Last-Modified", entries.OrderByDescending(x => x.ModifiedAt).First().ModifiedAt.ToUniversalTime().ToString("r"));

// Render Page
@RenderPage(flavourBody, pageData);
}

0 comments on commit 0298a3a

Please sign in to comment.