docs-kit 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/docs_kit/llms_controller.rb +7 -0
- data/lib/docs_kit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4fee711dcf42e9b92cf749684ea9b94c07ef9d614cf21746881f2c7402f744ea
|
|
4
|
+
data.tar.gz: 76e246db5be838d3b31b8f08a98d033c57e3765d82900245723afc32fd4cad5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a9cd702122f1e7af103b4279d7e3f4d45e8e662d5838931ac622383ce23609befd8557daddd2b3ac4afda772fc148cf0f5458546a8776b6bae3168408f59065
|
|
7
|
+
data.tar.gz: 05ce8bb90585331cdaefa92973c36b67d55b2b6164aae03f55d4679a35d8ce7c4128295e4919a3775123cecaa923355baf1622481741ca3a4312394d5b0dd0a2
|
|
@@ -47,6 +47,12 @@ module DocsKit
|
|
|
47
47
|
render_text(body) if stale_llms?(body)
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
+
# Freshness lifetime for a shared cache (dash-proxy, a CDN). `public` on its
|
|
51
|
+
# own is not storable under RFC 9111 — without a max-age the proxy cache
|
|
52
|
+
# skips the response. 300s matches the `proxy.cache.max_ttl` docs-kit
|
|
53
|
+
# scaffolds; the etag below still revalidates within that window.
|
|
54
|
+
LLMS_MAX_AGE = 300
|
|
55
|
+
|
|
50
56
|
private
|
|
51
57
|
|
|
52
58
|
# NOT named #config — ActionController::Base#config is the Rails config
|
|
@@ -66,6 +72,7 @@ module DocsKit
|
|
|
66
72
|
# busts it) plus the gem version as the etag salt. In development, always
|
|
67
73
|
# re-render; production sites deploy immutably so the version etag is stable.
|
|
68
74
|
def stale_llms?(body)
|
|
75
|
+
expires_in LLMS_MAX_AGE, public: true
|
|
69
76
|
stale?(etag: [DocsKit::VERSION, body], public: true)
|
|
70
77
|
end
|
|
71
78
|
|
data/lib/docs_kit/version.rb
CHANGED