-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcache.go
37 lines (33 loc) · 1.13 KB
/
cache.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package config
import (
"github.com/goravel/framework/facades"
)
func init() {
config := facades.Config()
config.Add("cache", map[string]any{
// Default Cache Store
//
// This option controls the default cache connection that gets used while
// using this caching library. This connection is used when another is
// not explicitly specified when executing a given caching function.
"default": config.Env("CACHE_STORE", "memory"),
// Cache Stores
//
// Here you may define all the cache "stores" for your application as
// well as their drivers. You may even define multiple stores for the
// same cache driver to group types of items stored in your caches.
// Available Drivers: "memory", "custom"
"stores": map[string]any{
"memory": map[string]any{
"driver": "memory",
},
},
// Cache Key Prefix
//
// When utilizing a RAM based store such as APC or Memcached, there might
// be other applications utilizing the same cache. So, we'll specify a
// value to get prefixed to all our keys, so we can avoid collisions.
// Must: a-zA-Z0-9_-
"prefix": config.GetString("APP_NAME", "goravel") + "_cache",
})
}