Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jesselau76/hugo-w3-simple.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjesselau76 <jesselau76@gmail.com>2019-03-06 12:38:32 +0300
committerjesselau76 <jesselau76@gmail.com>2019-03-06 12:38:32 +0300
commitc7f9de35346042cc15ef010f7d8d14480ed4f8ec (patch)
tree3ad2f81e774152d66fdb8fdc79eb78007f6023db
parent6b51fac125d68a2d4ba463d161968952b8b10d10 (diff)
set no cache for homepage, categories and tags
-rw-r--r--layouts/partials/head.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index ca40640..e8bc5c4 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,10 +1,17 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
-<meta http-equiv="Cache-Control" content="public" />
+{{ if .IsPage }}
+ <meta http-equiv="Cache-Control" content="public" />
+{{else}}
+ <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="0" />
+{{ end }}
{{ "<!-- Enable responsiveness on mobile devices -->" | safeHTML }}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
{{ .Hugo.Generator }}
{{ if .IsHome }}
+
{{ $.Scratch.Set "theTitle" .Site.Title }}
{{else}}
{{ $.Scratch.Add "theTitle" .Title}}