Title: Javascript file cache exclusion
Last modified: May 14, 2020

---

# Javascript file cache exclusion

 *  Resolved [zoonars](https://wordpress.org/support/users/zoonars/)
 * (@zoonars)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/javascript-file-cache-exclusion/)
 * Hello,
 * Reading the Getting Started page of WP-Optimize sheds light on the possibility
   of adding custom cache extensions, and I am trying to figure out how to add a
   functions.js file from within my theme to a cache exclusion list. Your information
   section briefly mentions the possibility but I am not sure how to follow through,
   could I get some help excluding a single .js file from caching?

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

 *  [Marc Lacroix](https://wordpress.org/support/users/marcusig/)
 * (@marcusig)
 * [6 years ago](https://wordpress.org/support/topic/javascript-file-cache-exclusion/#post-12831449)
 * Hi there,
 * I think you’re misunderstanding what the page cache functionality does.
    I saves
   the html contents of pages to files, and does not affect JavaScript files. So
   that’s the server side caching, for which you can build custom extensions.
 * JS files do not need caching server wise (unless if they’re somehow processed).
   
   On the other hand, WP-Optimize enables you to add browser cache headers, which
   simply tell the browser how long a file should be cached for.
 * Marc.
 *  Thread Starter [zoonars](https://wordpress.org/support/users/zoonars/)
 * (@zoonars)
 * [6 years ago](https://wordpress.org/support/topic/javascript-file-cache-exclusion/#post-12833694)
 * Hello and thank you for your response, I appreciate the clarification because
   at the moment I am investigating an issue with my site’s header caching the mobile
   version when on desktop mode and the reason I asked this question was a comment
   made by the theme developer suggesting to exclude a file from caching, here is
   the exact comment for reference,
 * “This [the caching issue] is a matter with the Compress CSS/JS and Cache with
   the Header Builder.
 * Please kindly try to disable it you will see the Header will display correctly.
 * You can also try to exclude the following file in your Cache plugin to see any
   difference:
 * wp-content\themes\wr-nitro\assets\woorockets\js\functions.js
 * Or all the folder:
 * wp-content\themes\wr-nitro\assets\woorockets\js
    “
 *  Plugin Author [David Anderson / Team Updraft](https://wordpress.org/support/users/davidanderson/)
 * (@davidanderson)
 * [6 years ago](https://wordpress.org/support/topic/javascript-file-cache-exclusion/#post-12834895)
 * WP-Optimize is a page cache. This means it caches the generated HTML when WordPress
   spits out a page. It doesn’t cache JavaScript files or assets within that page.
   These things are operating at different levels. So, your correspondent seems 
   a bit confused.
 *  Thread Starter [zoonars](https://wordpress.org/support/users/zoonars/)
 * (@zoonars)
 * [6 years ago](https://wordpress.org/support/topic/javascript-file-cache-exclusion/#post-12836723)
 * Your explanation of the difference makes sense, thank you. Ill bring this information
   to the individual.

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

The topic ‘Javascript file cache exclusion’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [zoonars](https://wordpress.org/support/users/zoonars/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/javascript-file-cache-exclusion/#post-12836723)
 * Status: resolved