Skip to content

Instantly share code, notes, and snippets.

@luizlopescom
Created September 12, 2020 22:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save luizlopescom/1db61372eb6ac11d9d542131250564a0 to your computer and use it in GitHub Desktop.
Save luizlopescom/1db61372eb6ac11d9d542131250564a0 to your computer and use it in GitHub Desktop.
List of WP Autoptimize plugin hooks
//Change AO folder and file prefix
//It's mandatory to have an underline
//serve files from e.g. /wp-content/resources/aggregated_12345.css
//wp_config.php
define('AUTOPTIMIZE_CACHE_CHILD_DIR','/resources/');
define('AUTOPTIMIZE_CACHEFILE_PREFIX','aggregated_');
//Enable non-ASCII characters
add_filter('autoptimize_filter_main_use_mbstring', '__return_true');
//Gzip AO files
add_filter(''autoptimize_filter_cache_create_static_gzip','true');
//Don't clear AO cache on cache purges
add_filter('autoptimize_filter_main_hookpagecachepurge','__return_false');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment