Title: defer autoptimized css file
Last modified: April 4, 2019

---

# defer autoptimized css file

 *  Resolved [niz91](https://wordpress.org/support/users/niz91/)
 * (@niz91)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/)
 * Hi Franck,
 * after running autoptimize criticalcss, i have 2 cached css file (autoptimize1234.
   css and autoptimize_single1234.css).
 * How can i defer this 2 files?
 * Thank you

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11394292)
 * well, both should no longer be render-blocking, as they are now “preloaded” (
   rel=”preload” iso rel=”stylesheet”), isn’t that the case?
 * frank
 *  Thread Starter [niz91](https://wordpress.org/support/users/niz91/)
 * (@niz91)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11401882)
 * i checked the source code :
 * `<link rel="stylesheet" id="tf-compiled-options-flux-settings-css" href="https://
   mywebsite.com/wp-content/cache/autoptimize/css/autoptimize_single_b978d06ae3d0b13fa741a43561478b9b.
   css" type="text/css" media="all">`
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11402139)
 * Hmm, that might be one of the edge-cases where AO 2.4 failed to switch to preload,
   can you [try with 2.5 beta](https://wordpress.org/support/topic/announcing-autoptimize-2-5/),
   that _should_ fix it?
 *  [beningen](https://wordpress.org/support/users/beningen/)
 * (@beningen)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11406097)
 * I have same problem. Tried installing 2.5 beta, but still same –
    Defer and inline
   is working, but I get rel=”stylesheet” not “preload” on my autoptimize css.
 * In case it helps… Site Ground (with SG optimizer switched off), Astra Theme, 
   Beaver Builder.
 * Ben
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11406369)
 * can you share your site’s URL Ben?
 *  [beningen](https://wordpress.org/support/users/beningen/)
 * (@beningen)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11415711)
 * Sorry for slow reply – [https://www.getsifta.com/](https://www.getsifta.com/)(
   This is just a test site, so happy to enable / disable anything to help troubleshoot)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11415747)
 * The linked CSS is not deferred because there is no matching critical CSS rule,
   so the aggregated CSS is inlined and the excluded CSS is not deferred. You can
   work around that by adding default critical CSS in the “critical CSS”-tab [@beningen](https://wordpress.org/support/users/beningen/).
 * hope this helps,
    frank
 *  [beningen](https://wordpress.org/support/users/beningen/)
 * (@beningen)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11415850)
 * Thanks – I tried what you suggested, but still not working.
 * I have noticed something else though… If I check Dev tools > network > Response–
   then initial response includes rel=”preload” but dev tools > inspect shows rel
   =”stylesheet”.
 * I think this means it is being rewritten by something (?)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11415918)
 * your HTML source code is correct now, example:
 * `<link rel="preload" as="style" media="all" href="https://www.getsifta.com/wp-
   content/cache/autoptimize/css/autoptimize_318928363d4f5d90cf95568efed9b64e.css"
   onload="this.onload=null;this.rel='stylesheet'" />`
 * or
 *     ```
       <link rel='preload' as='style' onload="this.onload=null;this.rel='stylesheet'" id='dashicons-css'  href='https://www.getsifta.com/wp-includes/css/dashicons.min.css?ver=5.1.1' type='text/css' media='all' />
       ```
   
 * (never mind the `<link rel="stylesheet"` between `<noscript>` tags, those don’t
   apply)
 * > I think this means it is being rewritten by something (?)
 * it’s supposed to, by virtue of the onload handler;
 *     ```
       onload="this.onload=null;this.rel='stylesheet'
       ```
   
 * hope this clarifies,
    frank
 *  [beningen](https://wordpress.org/support/users/beningen/)
 * (@beningen)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11415993)
 * Thanks Frank! Now I just need to work out why my rule is not matching. I’ll start
   a different thread if I cannot figure it out.
 *  Thread Starter [niz91](https://wordpress.org/support/users/niz91/)
 * (@niz91)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11416547)
 * hey, how did you solve the problem?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11416971)
 * in beningen’s case the did not have a matching rule for the homepage, as a result
   of which all aggregated CSS was inlined, which does not trigger the preload/ 
   defer action on linked CSS. adding a default (fallback) rule fixed that.

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

The topic ‘defer autoptimized css file’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/autoptimize-criticalcss.svg)
 * [Autoptimize criticalcss.com power-up](https://wordpress.org/plugins/autoptimize-criticalcss/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize-criticalcss/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize-criticalcss/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize-criticalcss/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize-criticalcss/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize-criticalcss/reviews/)

 * 12 replies
 * 3 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/defer-autoptimized-css-file/#post-11416971)
 * Status: resolved