Documentation

Assets (Deprecated): Settings

Copy & Serve

Copy assets to S3 and rewrite URLs for enqueued CSS & JS scripts. Disabling this option will serve all assets from your local server and prevent scans from running.

Automatic Scanning

Schedule a WordPress cron event to automatically scan for directory changes. New files will be uploaded, modified files replaced and deleted files removed from S3. This event is scheduled to fire every 5 minutes, but you should ensure cron is correctly configured. You can increase or decrease the frequency of the scan using the as3cf_assets_cron_files_s3_interval filter:

function as3cf_assets_cron_files_s3_interval() {
    return 10; // 10 minutes
}
add_filter( 'as3cf_assets_cron_files_s3_interval', 'as3cf_assets_cron_files_s3_interval' );

File Extensions

A comma separated list of file extensions to scan for and upload to S3.

Path

Upload your assets to a custom location within your bucket. This is useful if you are sharing the bucket across multiple sites. For example:

example1.com/assets/
example2.com/assets/
example3.com/assets/

Force HTTPS

Control the protocol of the S3 URLs. The default will be the protocol of the page the asset is on, but you can set it to be always HTTPS.

Minify

Minifying your CSS and JS assets will reduce file sizes by removing unnecessary or redundant data, such as spaces and line breaks. In order for the minified files to be served you must ensure SCRIPT_DEBUG is set to false. It’s also recommended that you disable minification in other third party plugins to reduce server load and potential conflicts.

Exclude Files From Minify

If minification is causing certain scripts or styles to break you can exclude them here. One file path per line.

You can also use the as3cf_minify_exclude_files filter. Simply return an array of excluded files, like so:

function as3cf_minify_exclude_files( $exclude ) {
    $exclude[] = '/abspath/wp-content/themes/twentyfifteen/genericons/genericons.css';

    return $exclude;
}
add_filter( 'as3cf_minify_exclude_files', 'as3cf_minify_exclude_files' );

Gzip

Compressing your assets can reduce file sizes by up to 90%, which can significantly reduce the amount of time it takes to download them. However, you should disable this option if your CDN supports automatic compression, as it will improve compatibility with very old browser by honoring the Accept-Encoding header.

Scan Now

Manually trigger a scan, which will upload any missing files to S3, remove those that no longer exist locally and re-upload any files that have been modified.

Purge

Remove all files from S3.

Webhook

Initiate a scan using a URL. This is useful if you want to trigger a scan on certain server events, such as deploying code changes via Git.

Scan only:

curl --silent http://example.com/?wpos3-assets-scan=flcmo7hduptkjmyhtokqp4udzrvem9zz

Purge and scan:

curl --silent http://example.com/?wpos3-assets-scan=flcmo7hduptkjmyhtokqp4udzrvem9zz&purge=1

All of the above settings can be defined in your wp-config.php file.