Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block duchu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
duchu /
Created Jan 10, 2019 — forked from tlongren/
Output Compression, Browser Caching, Asset Minification and Image Optimization for WordPress

Output Compression, Browser Caching, Asset Minification and Image Optimization

The following apache and nginx configurations will handle compression and browser caching. A few different WordPress plugins can be used for asset minification.

mod-pagespeed may be available for configuration as an apache or nginx module. If available, there's no need to use the individual apache or nginx configurations. Mod-pagespeed will handle compression and browser caching, making the apache and nginx configurations unnecessary. The WordPress plugins are still needed for asset minification as they ensure assets are loaded in the proper order once minified.

Image optimization should be done using the EWWW Image Optimizer plugin.

Apache Config

Output Compression


Hardening WordPress

Securing WordPress using a combination of configuration changes and plugins.

.htaccess and wp-config.php tasks

1. Add keys to wp-config.php

2. Hide .htaccess and wp-config.php

View S3FixExistingMedia.php
/* ======================================================
This script is NOT FULLY TESTED (not tested on Windows Server either)
USE AT YOUR OWN RISK - development environment Ubuntu Linux 14.04.3 LTS
The purpose of this script is for small websites and blogs
to have their existing media to work through Amazon S3
There's a great plugin, WP Offload S3, that we'll be tapping works great for new media, but this is a quick
You can’t perform that action at this time.