Leverage caching for non wordpress landing page

We built a landing page outside of our WP base. So it’s located side by side with the directories “wp-contnet,wp-admin ect”. It has a random name for now “landing”. We’re using total cache for the site itself and have a CDN included. We include our CDN file path for the landing directory, but can’t seem to figure out how to leverage browser caching.

So what we’ve done so far is variations of the following in an .htaccess file located in our “landing” directory.

# Leverage browser caching using mod_expires #
<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>
# End of Leverage browser caching using mod_expires #

Is this something that would work for this case? Are we not doing this correctly and can we do this knowing we have an htaccess higher up?

Read more here: Leverage caching for non wordpress landing page

Leave a Reply

Your email address will not be published. Required fields are marked *