2013-07-03, 10:48 AM
I think it's good idea to add option to simply cache styles on users browsers.
In css.php find:
change to for examample:
and of course add setting option to "Server and Optimization Options" (0, one hour [3600], etc).
Why this?
Becuase it's very simple, and in most cases, admins don't change styles often. If there is 3-4 css styles, on any request MyBB must initialize, include all plugins files, connect databse etc. (a lot of I/O for only CSS). I'ld like to do this in plugin, but there is no hook on css.php and init.php.
It doesn't conflict with many themes, because each request has other style id. Also, it of course work in MyBB 1.6.
In css.php find:
header("Content-type: text/css");
change to for examample:
header("Content-type: text/css");
header("Pragma: public");
header("Cache-Control: maxage=" . $mybb->settings['css_expire_time']);
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $mybb->settings['css_expire_time']) . ' GMT');
and of course add setting option to "Server and Optimization Options" (0, one hour [3600], etc).
Why this?
Becuase it's very simple, and in most cases, admins don't change styles often. If there is 3-4 css styles, on any request MyBB must initialize, include all plugins files, connect databse etc. (a lot of I/O for only CSS). I'ld like to do this in plugin, but there is no hook on css.php and init.php.
It doesn't conflict with many themes, because each request has other style id. Also, it of course work in MyBB 1.6.