Title: Settable ExpiresByType
Last modified: April 2, 2025

---

# Settable ExpiresByType

 *  Resolved [thefitrv](https://wordpress.org/support/users/thefitrv/)
 * (@thefitrv)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/settable-expiresbytype/)
 * Our site caches at several levels. AO -> WP Supercache -> NGINX Helper -> Cloudflare
 * (We also use a Divi theme variant, just to make this fun.)
 * We seem to be having a caching mismatch issue with AO. Due to the .htaccess file
   in AO’s root directory, our expiry time is set to like… a year. A30672000
 * Sure, I can edit the .htaccess file to work harmoniously with the rest of the
   site, but every time I clear the AO cache, it gets regenerated with the year-
   long expiration. Is it possible to set the default expires time to a user-defined
   value. Through an option would be best, but if I have to edit the plugin, please
   let me know how to do that safely.
 * Thanks

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/settable-expiresbytype/#post-18396248)
 * you can create a template for AO’s .htaccess in your WP_CONTENT_DIR with name`
   AO_htaccess_tmpl`, in that case AO will use that template instead of creating
   it’s own .htaccess.
 * that being said; if the contents of a file changes (before minification) the 
   hash which is part of the filename changes so the filename is different, so at
   that point the expiry time is … less relevant? 😉
 * hope this helps,
    frank
 *  Thread Starter [thefitrv](https://wordpress.org/support/users/thefitrv/)
 * (@thefitrv)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/settable-expiresbytype/#post-18396258)
 * Thanks for the speedy reply.
 * AO_htaccess_templ.htaccess?
 * or AO_htaccess_templ with no extension?
 *  Thread Starter [thefitrv](https://wordpress.org/support/users/thefitrv/)
 * (@thefitrv)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/settable-expiresbytype/#post-18396316)
 * Nevermind, I just tested it out.
 * For anyone reading this later – it’s AO_htaccess_templ with NO extension.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/settable-expiresbytype/#post-18396409)
 * confirmed 🙂
 * you’re welcome, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/autoptimize/reviews/#new-post)!
   🙂

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

The topic ‘Settable ExpiresByType’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)

 * 4 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/settable-expiresbytype/#post-18396409)
 * Status: resolved