mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Merge pull request #3735 from ErisDS/cache-invalidation
Adding author pages to cache invalidation
This commit is contained in:
commit
85a1902294
@ -80,7 +80,7 @@ cacheInvalidationHeader = function (req, result) {
|
||||
|
||||
// Don't set x-cache-invalidate header for drafts
|
||||
if (hasStatusChanged || wasDeleted || wasPublishedUpdated) {
|
||||
cacheInvalidate = '/, /page/*, /rss/, /rss/*, /tag/*';
|
||||
cacheInvalidate = '/, /page/*, /rss/, /rss/*, /tag/*, /author/*';
|
||||
if (id && post.slug) {
|
||||
return config.urlForPost(settings, post).then(function (postUrl) {
|
||||
return cacheInvalidate + ', ' + postUrl;
|
||||
|
@ -360,7 +360,9 @@ describe('Post API', function () {
|
||||
|
||||
var publishedPost = res.body;
|
||||
_.has(res.headers, 'x-cache-invalidate').should.equal(true);
|
||||
res.headers['x-cache-invalidate'].should.eql('/, /page/*, /rss/, /rss/*, /tag/*, /' + publishedPost.posts[0].slug + '/');
|
||||
res.headers['x-cache-invalidate'].should.eql(
|
||||
'/, /page/*, /rss/, /rss/*, /tag/*, /author/*, /' + publishedPost.posts[0].slug + '/'
|
||||
);
|
||||
|
||||
publishedPost.should.exist;
|
||||
publishedPost.posts.should.exist;
|
||||
@ -762,7 +764,9 @@ describe('Post API', function () {
|
||||
var jsonResponse = res.body;
|
||||
jsonResponse.should.exist;
|
||||
jsonResponse.posts.should.exist;
|
||||
res.headers['x-cache-invalidate'].should.eql('/, /page/*, /rss/, /rss/*, /tag/*, /' + jsonResponse.posts[0].slug + '/');
|
||||
res.headers['x-cache-invalidate'].should.eql(
|
||||
'/, /page/*, /rss/, /rss/*, /tag/*, /author/*, /' + jsonResponse.posts[0].slug + '/'
|
||||
);
|
||||
testUtils.API.checkResponse(jsonResponse.posts[0], 'post');
|
||||
jsonResponse.posts[0].id.should.eql(deletePostId);
|
||||
done();
|
||||
|
Loading…
Reference in New Issue
Block a user