angel3_cache 10.0.0
angel3_cache: ^10.0.0 copied to clipboard
A service that provides HTTP caching to the response data for Angel3
Change Log #
10.0.0 #
Breaking changes in 10.0.0 #
- Breaking:
ResponseCachebypasses requests with cookies, as it does those withAuthorization, so a page of a session is not served to others; setcacheRequestsWithCookiesif no cached response depends on cookies - Breaking:
ResponseCachedoes not store a response with aVaryother thanAccept-Encoding(one response is kept per path), aContent-Encodingset by the handler (it was served to clients that do not accept it), orCache-Control: no-cache; nor a response toHEAD(it has no body, and was served toGET), or one longer thanmaxEntryBytes
New in 10.0.0 #
ResponseCache(maxEntryBytes: ...)(default 1 MB), so the cache holds at mostmaxEntriestimes it, andResponseCache(cacheRequestsWithCookies: ...)
Fixes in 10.0.0 #
- Cache headers:
ResponseCachemarks only the responses it storesCache-Control: public, withLast-ModifiedandExpires, and keeps aCache-Controlthe handler set, where it replaced it on the first response.HEADresponses are no longer buffered CacheServicereads: A read or index that overlaps a write, even one still in progress, no longer stores what it read over the written version, so instances no longer serve it (or a removed record) until the timeout. Ended entries are removed, where one was kept for every record ever readCacheService.index: Returns a copy of the cached list, so a caller changing it does not change it for otherscacheSerializationResults:shouldCacheis asked before a cached result is reused, so a request it refuses gets a fresh one; the timeout counts from after an asyncshouldCache- Docs: The README tells how to install and use the package, and how to migrate from 9.x, and a
MapServiceused as the cache needsautoIdAndDateFields: false, or cached records get ids and dates of their own; responses of cached paths are buffered, not streamed
9.2.0 #
Behaviour changes in 9.2.0 #
ResponseCachestores only responses that are safe to share: status 200, no cookies, and not markedCache-Control: no-storeorprivate. Requests with anAuthorizationheader bypass the cache, and responses that are not cached no longer getCache-Control: publicheadersResponseCache.handleRequestbuffers the response on a cache miss, so normal responses are cached withoutres.useBuffer(); only buffered responses were, so most never wereResponseCacheanswers304 Not Modified(no body) when the client's copy is current, instead of the full body with 200
New in 9.2.0 #
ResponseCache(maxEntries: ...): memory is bounded (default 1024 entries), evicting expired, then least recently used, entries
Fixes in 9.2.0 #
- Memory:
ResponseCacheno longer keeps an entry and a lock for every distinct URL (including query strings) for ever - Responses: A cached response is sent with
Content-Length. A client sending back the exactLast-Modifiedvalue is recognised (dates are compared in whole seconds), and one with an older copy gets the cached response instead of bypassing the cache CacheServicewrites:modifyandupdateupdate, andremoveevicts, the entry in the sharedcacheservice, so other instances no longer serve stale or deleted records;updatecallsdatabase.updateinstead ofdatabase.modifyCacheService.read: Stores a cache miss withcache.update, under the requested id; no longer throws on params without aquery; uses the cache for reads without params; and falls back to the database when the cache is unavailablecacheSerializationResults: Works: results are cached per object across requests,shouldCacheandtimeoutare honoured, a result is reused only for the same serializer, and async serializers are supported- Dependencies: Removed the unused
poolandmeta, and the unused dev dependencyglob - Docs: The README is up to date
- Tests:
cache_test.dartis deterministic, and two assertions that expected the old behaviour are corrected
9.1.0 #
- Require Dart >= 3.13
9.0.0 #
- Require Dart >= 3.12
8.4.0 #
- Require Dart >= 3.8
- Updated
lintsto 6.0.0 - Updated dependencies to the latest release
8.3.0 #
- Require Dart >= 3.6
- Updated
lintsto 5.0.0 - Updated dependencies to the latest release
8.2.0 #
- Require Dart >= 3.3
- Updated
lintsto 4.0.0
8.1.1 #
- Updated repository link
8.1.0 #
- Updated
lintsto 3.0.0 - Fixed linter warnings
8.0.0 #
- Require Dart >= 3.0
7.0.0 #
- Require Dart >= 2.17
6.0.0 #
- Require Dart >= 2.16
5.0.0 #
- Skipped release
4.0.3 #
- Updated linter to
package:lints
4.0.2 #
- Updated README
- Added home page link
- All 7 unit tests passed
4.0.1 #
- Updated pubspec description
- Fixed: Return
200with cached data instead of403 - Updated broken unit tests
4.0.0 #
- Migrated to support Dart >= 2.12 NNBD
3.0.0 #
- Migrated to work with Dart >= 2.12 Non NNBD
2.0.1 #
- Add
ignoreQueryAndFragmenttoResponseCache. - Rename
CacheService.ignoreQuerytoignoreParams.
1.0.0 #
- First version