Mobile app version of vmapp.org
Login or Join
Barnes591

: Amazon EC2 Bitnami Wordpress Leverage Browser Caching Just setup a Wordpress site on an using an Amazon EC2 Bitnami AMI. I've ran the usual suspects of speed tests and have added this to my

@Barnes591

Posted in: #AmazonEc2 #CacheControl #Wordpress

Just setup a Wordpress site on an using an Amazon EC2 Bitnami AMI. I've ran the usual suspects of speed tests and have added this to my .htaccess file, like I've done dozens of times before:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>
## EXPIRES CACHING ##


However I still get the issues around saying I should leverage browser caching. Apache has restarted and even the server has been rebooted but same happens. I've checked the Apache2 config file and the mod_expires module is present (I'm 99% sure it is!)

Anything I'm missing that is maybe specific to Amazon EC2 and/or Bitnami Wordpress?

Standard Bitnami AMI... Linux version 3.13.0-100-generic

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Barnes591

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

There appear to be two things you need to check.

First edit /opt/bitnami/apache2/conf/httpd.conf and make sure that the line loading mod_expires is not commented out (comments start with #). If it is, uncomment it and restart Apache. (source)

If you are trying to set the expires headers in .htaccess you will also have to allow overrides in your Apache configuration. Edit httpd.conf and make sure that allowoverride all is specified. (source)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme