1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-23 20:03:43 +00:00

68 Commits

Author SHA1 Message Date
djunny
f9d5f787af
Feature: [Cache] add ExpirationGenerator for generate custom Expiration (#1618)
* Feature: [Cache] add ExpirationGenerator for generate custom Expiration

* fix: add document and code snippet for README

Co-authored-by: dj <github@djunny.com>
2021-11-11 11:30:38 +01:00
Gusted
7b7dcf29f7
♻️ Tidy up the codebase (#1613)
* run gofmt

* add t.Helper()

* Simplify assigns

* Simplify make operation

* Remove unused field in struct

* Fix typo

* Run gofumpt ./

* Consistent spacing

* len(...) can never be negative

* Use ReplaceAll

* Simplify operation

* Remove deadcode

* Fix typo

* Tidy up `} else { if ...`

* Fix AssertEqual

* Remove t.Helper() to fix go1.14.15
2021-11-05 08:00:03 +01:00
liaohongxing
a6aea1cdc5
fix cache docs error (#1612) 2021-11-03 16:49:26 +01:00
Michael Weiss
743d8ec08c
Fix comment (#1597)
When merging #1310, the corresponding adaptation of a code comment appears to have gone forgotten.
2021-10-25 18:37:50 +02:00
RW
2272e4a6b1
🐛 Get unexpected results from cache #1529 (#1531) 2021-09-15 14:20:43 +02:00
RW
d777d889bb
Fix cache expired test (#1461)
* Improve/Stabilize the "Test_Cache_Expired" test run
2021-07-30 20:19:18 +02:00
Kazumasa Takenaka (Bamboo)
f5338266e3
fix typo (#1442)
paramters -> parameters
avilable  -> available
seperated -> separated
2021-07-17 17:20:14 +02:00
Javad Rajabzade
7609117cec
Improved some conditions (#1386)
* simplify `u <= (1<<7)-1` to `u < (1 << 7)`

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* Instead Bool comparison can using simplified bool check if !var = false checking

* Unnecessary use of fmt.Sprintf for value without format

* For check condition two value not required ! method

* nil check may not be enough for slice, better check with len

* function parameters combined

* When the form returns error information, the text content should not start with a capital letter or end with a punctuation mark

* error var invalidPath should have name of the form errFoo, It is recommended that the error variables that are part of an API should be named

* change to condition len(x), it's faster https://github.com/gofiber/fiber/pull/1386#discussion_r652369520

* Update write.go

* Update write_bytes.go

* Update store.go

Co-authored-by: RW <rene@gofiber.io>
2021-06-17 22:03:59 +02:00
Wei Lun
bca01cc9cc
🔥 Feature: add cache header to show cache status (#1368)
* add cache header to show cache status

* update default CacheHeader to X-Cache

* add CacheHeader test

* Update cache_test.go

use constants in test

Co-authored-by: RW <rene@gofiber.io>
2021-06-13 10:52:03 +02:00
Ivan Sotnikov
15cb3dc025
🐛 Cache Middleware - Race condition in the cache expiration logic. Round 2 (#1310)
* 🐛 fix: decrease watchdog period time
2021-05-04 09:18:48 +02:00
Roman
ca0e784fb9
Refactor cache middleware to not-use the deprecated methods (#1246)
* ♻️ refactor: cache: don't use the deprecated `SafeBytes` and use `CopyBytes` instead

* ♻️ refactor: utils: remove deprecated and unused methods
2021-03-30 23:31:03 +02:00
Ivan Sotnikov
d9c13d3442
🐛 Set expiration time in test to 1.5 due to the timer error (#1229) 2021-03-19 19:10:53 +01:00
Ivan Sotnikov
b517de85ec
🐛 update expiration for expired entry (#1228) 2021-03-17 08:08:44 +01:00
tianjipeng
08a2e7a82d ajust cache middleware config.Next position 2021-01-26 10:26:13 +08:00
hi019
494474aebd
Merge branch 'master' into master 2020-12-13 22:08:51 -05:00
Fenny
142e6e53be 🩹 fix #1055 2020-12-06 16:43:24 +01:00
Fenny
323d9d89cc 🩹 fix manager logic 2020-11-23 07:38:42 +01:00
hi019
bc7b240158 improve mw 2020-11-21 12:36:16 -05:00
hi019
52ec20c3b4 do basicauth, cache and compress 2020-11-21 12:23:35 -05:00
Fenny
8fe458011d 📦 add mapstore 2020-11-20 11:43:07 +01:00
Fenny
f714660ca9 🩹 update mutex logic
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-11-17 13:15:32 +01:00
Fenny
cf4f60e965 🩹 update lock
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-11-17 13:12:42 +01:00
Fenny
9d5b58d210 🩹 remove mutex
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-11-17 13:06:59 +01:00
Fenny
a2f54222bb 🩹 remove return nil
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-11-17 13:05:17 +01:00
Fenny
9be8eedcc6 🩹 fix cache mw
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-11-17 13:03:18 +01:00
Fenny
56cf415a0a simplify storage handler
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-11-17 10:40:11 +01:00
Fenny
bb3a7fe5da 🩹 fix cache
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-11-17 08:33:07 +01:00
Fenny
de912755f7 📦 update session 2020-11-16 14:22:44 +01:00
Fenny
8bd50de610 🧹 housekeeping 2020-11-11 13:54:27 +01:00
Fenny
a9d628641e 🍌 increase sleep for workflow 2020-11-06 02:29:31 +01:00
Fenny
f02b8d8317 Merge remote-tracking branch 'upstream/master' 2020-11-06 02:28:39 +01:00
Fenny
0d3d6d9fe8 📦 update fasthttp and storage interface 2020-11-06 01:52:05 +01:00
Jay Chung
0146b92ba6 refactor: clean up 2020-11-04 23:17:00 +08:00
Joey
5d6e62b7c1
Merge pull request #984 from Fenny/master
✏ update Storage behaviour
2020-10-30 23:55:56 -07:00
Fenny
7892ab62bf 📦 update Storage behaviour 2020-10-31 07:51:44 +01:00
Tom
1ad625704d
📦 Add Key option to Cache config (#983) 2020-10-31 01:19:33 +00:00
Fenny
7ca70fcb17 🔍 verify body length
Co-Authored-By: kiyon <kiyon@gofiber.io>
2020-10-29 06:54:41 +01:00
Fenny
f5314b66b9 📈 update benchmark
Co-Authored-By: kiyon <kiyon@gofiber.io>
2020-10-29 06:50:09 +01:00
Fenny
cee3c759e3 🦺 copy cType in cache mw
Co-Authored-By: kiyon <kiyon@gofiber.io>
2020-10-29 06:43:59 +01:00
Fenny
5bc5f96324 🦺 make copy of body 2020-10-29 06:41:05 +01:00
Fenny
70d7c53557 🩹 fix race condition 2020-10-29 06:38:41 +01:00
Fenny
79c151c238 🚀 improve Store in cache mw 2020-10-29 06:32:09 +01:00
Fenny
7f3d31c4a3 🧹 remove unused code 2020-10-29 06:14:02 +01:00
Fenny
ecdda95e15 💼 implement Storage 2020-10-28 02:29:47 +01:00
Fenny
68e8684add
Merge pull request #898 from Fenny/master
📦 add cache benchmark + 1 min default
2020-10-08 18:13:18 +02:00
Fenny
33e91e8111 📦 add benchmark 2020-10-08 18:11:26 +02:00
Fenny
e090f5278a
Merge pull request #888 from Fenny/master
🧨 add public to max age header
2020-10-06 20:18:43 +02:00
Fenny
b37789836d 🧪 update cache test 2020-10-06 20:15:21 +02:00
Fenny
ad06443a7a 🧨 add public to max age header 2020-10-06 20:10:03 +02:00
Roman
180fedc0c4 🩹 fix the anchor tag and external references to fix the GH-generated link 2020-10-06 10:21:16 +02:00