Web Toolkit
This toolkit is a collection of small scripts and settings that seem to make their way into most of my projects.
To integrate the scripts seamlessly there are some re-write rules in /.htaccess. That’s probably where you should start.
Check out the source in its repository.
.htaccess file
- Configures ETags
- GZIPs text files
- Adds Expires headers
- Forces PDFs to ask before opening Acrobat
- Installs query string hooks for JPEG resizing
- Installs run-time JS compression
- Installs run-time CSS compression
- Enforces some URL canonicalization
Run-time Javascript compression
All .js files are automatically run through Dean Edward’s JS packer, cached and then displayed.
Run-time CSS compression
All .css files are automatically run through iBloom Studio’s CSS compressor, cached and then displayed.
Run-time JPEG formatting
Images are transformed using ImageMagick, cached and then displayed. This is most useful for galleries with thumbnails and for handling user uploads.
Usage
- Add “modes” and conversion strings to scripts/jpeg_format.php
- Add modes to .htaccess
- When calling images, append the mode to the JPEG's querystring (e.g. /images/test.jpg?thumb)
Contact
Written by Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007.