Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

286
Views
Can't enable cache control on apache server

I am running a AWS Lightsail Bitnami instance with Wordpress installed. I am trying to enable Cache Control. I have tried adding these directives to the .htaccess file:

# 1 YEAR
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|woff|woff2|ttf|eot)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>

# 1 WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>

# 1 WEEK
<FilesMatch "\.(txt|xml|js|css)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>

I have also tried uncommenting this line in httpd.conf: LoadModule expires_module modules/mod_expires.so I added a expires.conf file in the /opt/bitnami/apache2/conf folder. I added this code:

<IfModule mod_expires.c>
  ExpiresActive on

  ExpiresByType image/jpg “access plus 60 days”
  ExpiresByType image/png “access plus 60 days”
  ExpiresByType image/js “access plus 60 days”
  ExpiresByType image/jpeg “access plus 60 days”
  ExpiresByType text/css “access plus 1 days”
</IfModule>

I restarted the apache server after these changes. My files are still not being cached. The Lightsail instance comes preconfigured with pagespeed as well.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Bitnami Engineer here,

The Bitnami stacks don't use the information in the .htaccess files due to security and performance reasons. To do so, we configure Apache with "AllowOverride None" and create a htaccess.conf file inside the /opt/bitnami/apps/wordpress/conf. If you want to include any custom configuration in your app, you will need to edit that file.

You can find more information here:

https://docs.bitnami.com/aws/apps/wordpress/administration/use-htaccess/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!