예제 #1
0
func getCacheKey(ctx echo.Context) string {
	cacheKey := ""
	if cacheKeyAlgorithm, ok := CacheKeyAlgorithmMap[ctx.Path()]; ok {
		// nil 表示不缓存
		if cacheKeyAlgorithm != nil {
			cacheKey = cacheKeyAlgorithm.GenCacheKey(ctx)
		}
	} else {
		cacheKey = defaultCacheKeyAlgorithm(ctx)
	}

	return cacheKey
}