Merge pull request #687 from trheyi/main
fix sui page locale and theme data caching bug
This commit is contained in:
commit
f8c7cbf23c
1 changed files with 7 additions and 0 deletions
|
|
@ -114,6 +114,13 @@ func (r *Request) Render() (string, int, error) {
|
||||||
if !r.Request.DisableCache() && c.DataCacheTime > 0 && c.CacheStore != "" {
|
if !r.Request.DisableCache() && c.DataCacheTime > 0 && c.CacheStore != "" {
|
||||||
data, dataHitCache = c.GetData(dataCacheKey)
|
data, dataHitCache = c.GetData(dataCacheKey)
|
||||||
if dataHitCache {
|
if dataHitCache {
|
||||||
|
if locale, ok := data["$locale"].(string); ok {
|
||||||
|
r.Request.Locale = locale
|
||||||
|
}
|
||||||
|
|
||||||
|
if theme, ok := data["$theme"].(string); ok {
|
||||||
|
r.Request.Theme = theme
|
||||||
|
}
|
||||||
log.Trace("[SUI] The page %s data is cached %v file=%s key=%s", r.Request.URL.Path, c.DataCacheTime, r.File, dataCacheKey)
|
log.Trace("[SUI] The page %s data is cached %v file=%s key=%s", r.Request.URL.Path, c.DataCacheTime, r.File, dataCacheKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue