Hey guys,
first, ProcessWire is a great piece of software. Thanks for that and the great community behind that. So, i'm realy new to ProcessWire, but i will present you my first module for SEO- and performance optimizing: AIOM+ (All In One Minify).
AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
AIOM+ (All In One Minify) is a module to easily improve the performance of your website. By a simple function call Stylesheets, LESS and Javascript files can be parsed, minimized and combined into one single file. This reduces the server requests, loading time and minimizes the traffic. In addition, the generated HTML source code can be minimized and all generated files can be loaded over a cookieless domain (domain sharding).
Install AIOM+
Download current release (link below) Extract and copy the files for this module to /site/modules/AllInOneMinify/ Login to PW backend and go to Modules > Check for new modules Install Module > AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
Alternative in ProcessWire 2.4
Login to PW backend and go to Modules Click tab "new" and enter Module Class Name: "AllInOneMinify" Click "Download and Install"
Features
Combining stylesheets / LESS files or JavaScripts
Minimize the combined files
No change to the .htaccess necessary (except for the domain sharding)
Server-side LESS parsing without plugins
HTML source code minimization
Cookieless domain / domain sharding
Automatic cache management (With changes to the source file, the cache is rebuilt)
Configurable via the backend
Automatic rewriting the paths in the stylesheet and LESS files. No changes are needed
Optional developer mode (combining, but no minimize and browser cache prevention)
Clear the cache on the backend
Conditional loading for CSS, LESS and JS (since Version 3.1.1)
How to use
Minimize multiple stylesheet or LESS files into one file. You can even mix stylesheet and LESS files in parsing and combining process!
<link rel="stylesheet" href="<?php echo AIOM::CSS(array('css/file-1.css', 'css/file-2.less', 'css/file-3.css', 'css/file-4.less')); ?>">
Minimize multiple javascript files into one file.
<script src="<?php echo AIOM::JS(array('js/file-1.js', 'js/file-2.js', 'js/file-3.js', 'js/file-4.js')); ?>"></script>
Conditional loading (same with Javascripts)
<?php $stylesheets = array('css/reset.css',
'css/main.less',
array('loadOn' => 'id|template=1002|1004|sitemap', // PW API selector
'files' => array('css/special.css', 'css/special-theme.less'))); ?>
<link rel="stylesheet" type="text/css" href="<?php echo AIOM::CSS($stylesheets); ?>" />
More Information, Documentation and Download
AIOM+ in ProcessWire repository
AIOM+ on GitHub
So, I hope you can do something with this module.
Dave