Title: No Garbage Collection for JavaScript Cache Files
Last modified: August 30, 2016

---

# No Garbage Collection for JavaScript Cache Files

 *  Resolved [muehlwitz](https://wordpress.org/support/users/muehlwitz/)
 * (@muehlwitz)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/)
 * I have to delete all Files in /wp-content/cache/autoptimize/js manually every
   week. At the Moment the Directory contains 15.000 Files / 3GB. The CSS dir only
   Contains ~100 Files. This results in a not Working WordPress because the Quota
   is exceeded. What is wrong?
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

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

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258403)
 * there’s info [in the FAQ](https://wordpress.org/plugins/autoptimize/faq/) on 
   that specific topic muehlwitz.
 * the (almost) one-liner summary:
    you have page- specific JS resulting in no 2
   pages having the same JS, breaking the caching. exclude that from aggregation
   and you’ll be all right.
 * hope this helps,
    frank
 *  Thread Starter [muehlwitz](https://wordpress.org/support/users/muehlwitz/)
 * (@muehlwitz)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258414)
 * Hi Frank,
 * thanks for answering so fast. After comparing two Cache Files you are right, 
   the Plugin “WordPress Popular Posts” creates inline JavaScript that is different
   on each page. Though – for the Moment i see no Option / a way to exclude Inline
   JavaScript, only Full Scripts !?
 * Guido
 *  Thread Starter [muehlwitz](https://wordpress.org/support/users/muehlwitz/)
 * (@muehlwitz)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258422)
 * Just found out that i can remove Inline JavaScript via Action Name, the german
   Translation does not refer to this
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258423)
 * indeed; suppose you have
 *     ```
       <script>so="etwas";</script>
       ```
   
 * then you can simply add `etwas` to the comma-seperated list of JS exclusion.
 * Kind regards,
    frank
 *  Thread Starter [muehlwitz](https://wordpress.org/support/users/muehlwitz/)
 * (@muehlwitz)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258430)
 * Had to remove 3 Inline Skripts, tested it with several Pages which results in
   onle ony Cache-File. Thanks for Helping!
 *  [funkychd](https://wordpress.org/support/users/funkychd/)
 * (@funkychd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258534)
 * the plugin is using loads of space on my host in
    wp-admin–> wp-content–> autooptimize–
   > js 100 mb and it increases daily . is this normal or something need to be done
 *  i am no tech — and icant understand what you guys posted above. can you provider
   a solution
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258536)
 * the easy explanation: you have a plugin which inserts ever-changing JS, which
   means AO can’t re-use an already cached optimized JS-file so it will keep on 
   recreating new optimized JS-files.
 * the easiest solution: add this to your theme’s functions.php (make a backup of
   that file first, if you’re not comfortable doing this find someone who can assist,
   errors can break your site entirely):
 *     ```
       add_filter('autoptimize_js_include_inline','funkychd_ao_js_include_inline',10,1);
       function funkychd_ao_js_include_inline() {
       	return false;
       	}
       ```
   
 * this will tell AO not to aggregate any JavaScript in the HTML (which typically
   is where such ever-changing JS is injected).
 * hope this helps,
    frank
 *  [funkychd](https://wordpress.org/support/users/funkychd/)
 * (@funkychd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258537)
 * got it , thanks , should i add these lines towards the end or any specific point.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258538)
 * at the end would be fine 🙂

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

The topic ‘No Garbage Collection for JavaScript Cache Files’ 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

 * [autooptimize](https://wordpress.org/support/topic-tag/autooptimize/)
 * [garbage](https://wordpress.org/support/topic-tag/garbage/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 9 replies
 * 3 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/no-garbage-collection-for-javascript-cache-files/#post-6258538)
 * Status: resolved