You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
14
14
-**Query Builder caching:** supported `DB::table()` reads now participate in NormCache automatically, alongside Eloquent reads. Writes through those cache-aware builders invalidate affected tables automatically.
15
15
-**Unified dependencies:**`dependsOn()` now accepts Eloquent model classes and raw table names in one declaration.
16
-
-**Automatic Result Overlays:** canonical queries returning up to `auto_overlay_max_rows` (default 50) automatically store a complete result payload in Redis, letting warm reads execute in a single Redis `GET` (~80–120 µs) while retaining canonical fallback and self-healing.
16
+
-**Automatic Result Overlays:** canonical queries returning up to `auto_overlay_max_rows + 1` rows automatically store a complete result payload in Redis when its encoded size is at most 50 KiB. The extra row accommodates Laravel's simple/cursor pagination lookahead; with the default value of 50, payloads containing up to 51 rows are eligible. No explicit SQL `LIMIT` is required.
17
17
-**Global tags:** use `tag('name')` to group cached query payloads and `NormCache::flushTag('name')` to invalidate that group.
18
18
-**Unified manual invalidation:**`NormCache::invalidate()` accepts a model instance, model class, table name, or an array of those targets. A model target uses its model connection; table targets use Laravel's default connection unless `connection:` is supplied.
19
19
-**Runtime cache switch:**`normcache:disable` and `normcache:enable`, plus `disableCache()`, `enableCache()`, and `cacheDisabled()`, pause caching across application nodes. Re-enabling advances the global epoch before serving cached data again.
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,8 @@ At the core of NormCache is **normalized row storage**. Unlike traditional query
67
67
68
68
NormCache automatically optimizes warm query performance by storing single-step result overlays in Redis for eligible canonical queries:
69
69
70
-
-**Automatic Promotion**: Canonical queries returning up to `auto_overlay_max_rows` (default `50`) automatically store a serialized result payload in Redis (`table:e:v1:...`).
70
+
-**Automatic Promotion**: Canonical queries returning up to `auto_overlay_max_rows + 1` rows automatically store a serialized result payload in Redis (`table:e:v1:...`) when its encoded size is less than 50 KiB. With the default configuration of `50`, payloads containing up to 51 rows are eligible. An explicit SQL `LIMIT` is not required.
71
+
-**Pagination lookahead allowance**: Laravel's `simplePaginate()` and `cursorPaginate()` fetch one extra row to detect a next page. The one-row allowance avoids excluding a 50-item page solely because its SQL result contains 51 rows. The complete payload, including the lookahead row, must still fit within 50 KiB.
71
72
-**Instant Synchronization & Self-Healing**: Updates to underlying models or dependency tables instantly invalidate the overlay alongside canonical storage. If an overlay key expires or misses, NormCache seamlessly falls back to canonical row assembly and repromotes automatically.
72
73
73
74
## Tags and selective flushing
@@ -102,7 +103,7 @@ Author::query()
102
103
->get();
103
104
```
104
105
105
-
`dependsOn()` accepts Eloquent model classes and table names. It authorizes an otherwise opaque query only when NormCache can resolve all declared dependencies. Volatile expressions such as random, UUID, clock, connection-state, or sleep functionsare never cached.
106
+
`dependsOn()` accepts Eloquent model classes and table names. It authorizes an otherwise opaque query only when NormCache can resolve all declared dependencies. Recognized volatile expressions—including random, UUID, clock, connection-state, sequence-state, and sleep functions—are never cached.
106
107
107
108
## Invalidation
108
109
@@ -148,6 +149,7 @@ return [
148
149
149
150
'row_ttl' => 604800,
150
151
'query_ttl' => 3600,
152
+
// Set to 0 to disable automatic result overlays. Admission allows this value plus one row for pagination lookahead; encoded overlays are capped at 50 KiB.
0 commit comments