Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor A5hleyRich

    (@a5hleyrich)

    If you enable ‘Far Future Expiration Header’ under the advanced options, all assets will be uploaded with an ‘Expires’ header. The reason we use ‘Expires’ and not ‘Cache-Control’ is because it’s supported on older browsers.

    I’ll raise an issue with the team to discuss whether we should also add the ‘Cache-Control’ header, which is the newer of the two headers. Browsers which support both will default to using ‘Cache-Control’, which seems like the best solution.

    You can also add your own headers in the meantime using the as3cf_object_meta filter.

    Thread Starter Jeffrey Carandang

    (@phpbits)

    Thanks! I’ve enabled the option. Let me check if that feature will work on ‘Leverage Browser Caching’. If not, I’ll add the filter. Thanks!

    Cheers,
    phpbits

    You can add the cache control header for file using following code either in filter as mentioned in above post(recommended) or by directly adding this line at amazon-s3-and-cloudfront/classes/amazon-s3-and-cloudfront.php:593 above ‘Expires’ header.(not recommended)

    $args[‘CacheControl’] = ‘max-age=31536000, public’;

    Plugin Contributor A5hleyRich

    (@a5hleyrich)

    There’s no need to modify the plugin code, please use the filter provided.

    The cache-control header will be implemented in the next release, which is due soon.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Leverage Browser Caching’ is closed to new replies.