Item13950: Refresh cache needs better controls, to minimize bot clicks.
Priority: Normal
Current State: Closed
Released In: 2.1.1
Target Release: patch
Change the refresh cache link to a javascript based control to minimize bot clicks:
diff --git a/PatternSkin/templates/view.pattern.tmpl b/PatternSkin/templates/view.pattern.tmpl
index 4b75c90..a0ac34b 100644
--- a/PatternSkin/templates/view.pattern.tmpl
+++ b/PatternSkin/templates/view.pattern.tmpl
@@ -70,7 +70,7 @@
}%%TMPL:DEF{"cacheinfo"}%%IF{"{Cache}{Enabled} and $CACHEABLE != 'off'"
then="<span class='patternCacheInfo'>
- %MAKETEXT{"This page was cached on [_1]." args="%SERVERTIME%"}%
- %MAKETEXT{"Get a fresh version <a href='[_1]' rel='nofollow'>here</a>." args="%SCRIPTURLPATH{view}%/%BASEWEB%/%BASETOPIC%?refresh=cache"}%
+ %MAKETEXT{"Get a fresh version <a href='javascript:void(0)' rel='nofollow' onclick='window.location.href=[_1]' >here.</a>" args="$quot%SCRIPTURLPATH{"view" topic="%BASEWEB%.%BASETOPIC%" refresh="cache"}%$quot"}%
</span>"
}%%TMPL:END%%{
---------------------------------------------------
In addition, the full refresh should have additional controls.
--
GeorgeClark - 10 Feb 2016
I don't think this is a good approach to code an onclick handler for that purpose. Instead I'd only render a refresh button for authenticated users.
%IF{"context authenticated"
then="%MAKETEXT{"Get a fresh version <a href='[_1]'>here</a>." args="%SCRIPTURLPATH{view}%/%BASEWEB%/%BASETOPIC%?refresh=cache"}%"
}%
--
MichaelDaum - 10 Feb 2016