ndeet / plg_system_less

A Joomla! system plugin to compile .less files on the fly.
GNU Lesser General Public License v3.0
17 stars 13 forks source link

Browser cache optimization: file_put_contents vs. fwrite #15

Closed fschroedter closed 11 years ago

fschroedter commented 11 years ago

I don't know why, but writing the template.css via less.php with file_put_contents(...) produces a different http header than using fwrite(...).

I always get a status code "OK" (200) using file_put_contents(...) but "Not Modified" (304) for fwrite(...) after refreshing the page. So using fwrite() instead of file_put_contents has a better browser cache behaviour, because the template.css generated by less.php will be loaded only once.

I'm using Firefox 23.0.1. The Server is an 1und1 Webspace with php 5.4