* GOTCHA #1: When sending the headers for caching, we must send Expires,
* Last-Modified, Pragma, and Cache-Control headers. If we don't PHP
* will makeup values that will break the cacheing.
*
* GOTCHA #2: If the current template does not contain a template named
* stylesheet.tpl, this cacheing will break because filemtime() won't
* work. This is a problem e.g. with the default_advanced template
* that inherits CSS properties from the default template but
* doesn't contain stylesheet.tpl itself.
IDEA: So ask the Template class object to return the mtime or better yet, the full file path (at least from SM_PATH) by using $oTemplate->get_template_file_path(stylesheet.tpl) but this is still a problem if the default template also does not have such a file (in which case, we fall back to SM's css/deafult css file (so in that case, go get that file's mtime!)
* Possibly naive suggestion - template can define its own default
* template name
*
* GOTCHA #3: If the user changes user prefs for things like font size then
* the mtime should be updated to the time of that change, and not
* that of the stylesheet.tpl file. IDEA: can this be a value kept
* in user prefs (always compare to actual file mtime before sending
* to the browser)
*
* Comment re gotcha #3: If we only define basic font prefs here, we really
* only need to refresh the cache if one of the font prefs changes.
* Possibly some type of "force nocache flag could be set if a font pref is
* changed?
*
* Response: Perhaps, if that can be implemented great, but I think the
* user prefs solution would definitely work: catch the font setting change
* in a custom save() routine from user prefs and away we go.
*
* TODO: Fix this. :)
*/
if ( $lastmod = @filemtime(SM_PATH. $oTemplate->get_template_file_directory()
. 'css/stylesheet.tpl') ) {
$gmlastmod = gmdate('D, d M Y H:i:s', $lastmod) . ' GMT';
$expires = gmdate('D, d M Y H:i:s', strtotime('+1 week')) . ' GMT';