Last active
August 29, 2015 13:57
-
-
Save Macagare/9553728 to your computer and use it in GitHub Desktop.
Floor current dateTime to influence the Last-Modified header. Header widgets will only be loaded from server every 15 minutes. Reduces server load when the requested content needs to be generated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
function foor15Min(t) { | |
var roundedMinutes = INT(minute(t) / 15 ) * 15; | |
return CreateDateTime(year(t), month(t), day(t), hour(t),roundedMinutes,0) | |
} | |
</cfscript> | |
<CFHEADER NAME="Cache-Control" VALUE="public, max-age=900"> | |
<CFHEADER NAME="Last-Modified" VALUE="#LSDateFormat(#foor15Min( DateConvert( 'Local2UTC', now() ) )#, 'ddd, dd mmm yyyy')# #LSTimeFormat(#foor15Min( DateConvert( 'Local2UTC', now() ) )#, 'HH:mm:ss')# GMT"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment