mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
Fixed incorrect cache invalidation headers for slugs Admin API endpoint (#19753)
closes ENG-666 - the Admin API `GET /slugs/{type}/{slug}/` endpoint is used by Admin to check when a potential slug needs de-duping by adding a `-{x}` suffix. Most often this occurs when setting a draft post title - the endpoint was returning a full-site cache invalidation header meaning hosting services could be blowing away their site caches and needlessly hurting performance because this endpoint is purely a read operation and makes no changes to the site - updated the endpoint to return no cache invalidation header
This commit is contained in:
parent
3a0fd45958
commit
ab7c1cfa92
@ -16,7 +16,7 @@ module.exports = {
|
||||
docName: 'slugs',
|
||||
generate: {
|
||||
headers: {
|
||||
cacheInvalidate: true
|
||||
cacheInvalidate: false
|
||||
},
|
||||
options: [
|
||||
'include',
|
||||
|
@ -20,7 +20,7 @@ describe('Slug API', function () {
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200);
|
||||
|
||||
should.exist(res.headers['x-cache-invalidate']);
|
||||
should.not.exist(res.headers['x-cache-invalidate']);
|
||||
const jsonResponse = res.body;
|
||||
should.exist(jsonResponse);
|
||||
should.exist(jsonResponse.slugs);
|
||||
|
Loading…
Reference in New Issue
Block a user