my latest
Rambling: 323 days of failure - read it
Fri 19th Nov
Tweet: kevbaldwyn: 6 hour ferry ride on the slowest boat in the Maldives and 3 hours later I still feel like I'm on a boat.
Wed 15th Feb
Code: Image and resource caching with htaccess - read it
Wed 23rd Mar
my photos
Hassan II Mosque, Wide Angle - Casblanca
Hassan II Mosque, Front - Casblanca
Hassan II Mosque, Polarised - Casblanca
Hassan II Mosque - Casblanca
Casablanca
The magical world of Disney
The Disney Castle
Snowy Branch
 

Image and resource caching with htaccess

Wednesday 23rd March '11

This is as much a bookmark for myself as anything. I just discovered this .htaccess trick to easily set resource caching with apache. It requires mod_headers enabled which comes compiled by default but switched off. Then all you need do is add something like this to your .htaccess file:

<IfModule mod_headers.c>
	<FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf)$">
	Header set Cache-Control "max-age=2592000"
	</FilesMatch>
</IfModule>

Which will cache images and flash for one month. The link posted above has loads more info.

Using Postmark to send emails with SwiftMailer

Sunday 23rd January '11

SwiftMailer as I've mentioned before is a great php library for creating and sending emails. Along with a great plugin architecture it is by default setup to handle SMTP, sendmail and php's native mail() function as transport agents for the email.

Recently I discovered and started using Postmark in a project. There can be so many issues with emails generated by a website; messages being marked as spam for numerous reasons, MTA issues, blacklisted IP addresses, shared servers, Hotmail rejecting your email, SPF records, reverse DNS, domain keys and plenty more to think about. Postmark takes care of all this for you, as they say on their website: "Postmark helps small and large businesses...