Skip to content

Commit 750f518

Browse files
committed
no more cacheClear
1 parent 26bba5e commit 750f518

3 files changed

Lines changed: 1 addition & 40 deletions

File tree

cache/__tests__/cache.test.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import {
1414
cacheSince,
1515
cacheGogFragments,
1616
cacheGogGlosses,
17-
cacheStats,
18-
cacheClear
17+
cacheStats
1918
} from '../middleware.js'
2019
import cache from '../index.js'
2120

@@ -384,27 +383,6 @@ describe('Cache Middleware Tests', () => {
384383
})
385384
})
386385

387-
describe('cacheClear endpoint', () => {
388-
it('should clear all cache entries', () => {
389-
// Populate cache with some entries
390-
const key1 = cache.generateKey('id', 'test123')
391-
const key2 = cache.generateKey('query', { type: 'Annotation' })
392-
cache.set(key1, { data: 'test1' })
393-
cache.set(key2, { data: 'test2' })
394-
395-
expect(cache.cache.size).toBe(2)
396-
397-
cacheClear(mockReq, mockRes)
398-
399-
expect(mockRes.json).toHaveBeenCalled()
400-
const response = mockRes.json.mock.calls[0][0]
401-
expect(response.message).toBe('Cache cleared')
402-
expect(response.entriesCleared).toBe(2)
403-
expect(response.currentSize).toBe(0)
404-
expect(cache.cache.size).toBe(0)
405-
})
406-
})
407-
408386
describe('Cache integration', () => {
409387
it('should maintain separate caches for different endpoints', () => {
410388
// Query cache

cache/docs/DETAILED.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,6 @@ Returns cache performance metrics:
327327
]
328328
}
329329
```
330-
331-
### Cache Clear (`POST /v1/api/cache/clear`)
332-
**Handler**: `cacheClear`
333-
334-
Clears all cache entries:
335-
```json
336-
{
337-
"message": "Cache cleared",
338-
"entriesCleared": 234,
339-
"currentSize": 0
340-
}
341-
```
342-
343330
---
344331

345332
## Smart Invalidation

cache/docs/TESTS.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ npm run runtest -- cache/__tests__/cache-limits.test.js
8888
- ✅ Return cache statistics at top level (hits, misses, hitRate, length, bytes, etc.)
8989
- ✅ Include details array when requested with `?details=true`
9090

91-
#### cacheClear Endpoint (1 test)
92-
- ✅ Clear all cache entries
93-
- ✅ Return correct response (message, entriesCleared, currentSize)
94-
9591
#### Cache Integration (2 tests)
9692
- ✅ Maintain separate caches for different endpoints
9793
- ✅ Only cache successful responses (skip 404s, errors)

0 commit comments

Comments
 (0)