spree_cm_commissioner 2.5.2 → 2.5.3
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e4c3bba39cc1a8f8a2cd7abdf91065bbd8caccfc1f574af9b5de4459822a5b3
|
|
4
|
+
data.tar.gz: 0abd8b1b6e4c7c83260d6a958039ba59dc8f29284cf62e6ce5769ca8142aef16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff309e440231910a83c35e4a70b0086eb21965e28a136952099893007b9ab09acd6a7a623129da5f15182a2edaac0b9a51692c0177036255838299d39600edea
|
|
7
|
+
data.tar.gz: df15ec71ab9bfe6f9ad4f0bc20016085ffda814a3167758560e79f1f0e1397fa6fbd4202b37d1a8a46f1fd6b725d47440e85bf66fad283dbf80e46f8c4351236
|
data/Gemfile.lock
CHANGED
|
@@ -15,10 +15,17 @@ module SpreeCmCommissioner
|
|
|
15
15
|
return if response.committed?
|
|
16
16
|
return if response.status != 200
|
|
17
17
|
|
|
18
|
-
# max-age: browser cache, s-maxage: server cache
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
response.headers['
|
|
18
|
+
# max-age: browser/client cache, s-maxage: CDN/server cache
|
|
19
|
+
# Allow client caching for mobile apps while keeping CDN cache longer
|
|
20
|
+
client_max_age = [max_age / 2, 300].max # At least 5 minutes, or half of CDN cache
|
|
21
|
+
response.headers['Cache-Control'] = "public, max-age=#{client_max_age}, s-maxage=#{max_age}"
|
|
22
|
+
|
|
23
|
+
# Pragma: HTTP/1.0 cache directive (predates Cache-Control).
|
|
24
|
+
# 'cache' allows caching.
|
|
25
|
+
response.headers['Pragma'] = 'cache'
|
|
26
|
+
|
|
27
|
+
# Expires: Absolute timestamp when cache becomes stale (HTTP/1.0 fallback)
|
|
28
|
+
response.headers['Expires'] = (Time.zone.now + client_max_age).httpdate
|
|
22
29
|
end
|
|
23
30
|
end
|
|
24
31
|
end
|