ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/webp "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/svg "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 3 days"
Header set Cache-Control "max-age=96000, public"
SetOutputFilter DEFLATE
FilesMatch "\.(pdf|doc|avi|mp4|zip)$">
Header set Cache-Control "max-age=604800, public"
# BerqWP Caching Rules Ends Here
EOD;
// Append the new rules to the .htaccess file
file_put_contents($htaccessFile, $currentContent . $newRules);
}
}
}