Moderator’s note: Moved to Howto.
As the post title hopefully suggests I’m trying (and failing) to set future expires headers on my EE-outputted CSS files.
By default EE seems to want to serve my CSS files with expires headers of 7/26/1997, resulting in 3 extra HTML requests for every page load. Boo!
So the obvious/simplest way to do this seemed to be to set the headers using PHP in each of my 3 CSS files and then cache the output of those files (to mitigate the extra overhead of having php enabled in these templates). Alas I’m clearly doing something wrong, as it ain’t working.
My php looks like this, and lives at the very top of my template files:
header('Expires: Thu, 15 Apr 2015 20:00:00 GMT');
PHP is set to allowed and parse on output, in my template preferences. I’ve confirmed PHP as allowed via a simple echo, however my headers are not being set.
I’d prefer not to post a URL here but will happily PM it to any one who thinks they can help.
Any help or suggestions would be very gratefully received.