                                          :num-files (count recompile-sources)}]
             (-> cache-index
                 (assoc :SHADOW-CACHE-KEY SHADOW-CACHE-KEY
+                       :CACHE-OPTIONS cache-options
                        :polyfill-js (:polyfill-js state)
                        :injected-libs (::injected-libs state))
                 (util/reduce->

                  (cache/write-file cache-file output)

                  (assoc idx resource-id cache-key)))
              (assoc cache-index :SHADOW-CACHE-KEY SHADOW-CACHE-KEY)
              recompile-sources)))]

    (when need-compile?

            (do (io/make-parents cache-index-file)
                {}))

        cache-options
        (->> cache-affecting-options
             (map #(get-in state %))
             (into []))

        cache-files
        (if (or (not= SHADOW-CACHE-KEY (:SHADOW-CACHE-KEY cache-index))
                (not= cache-options (:CACHE-OPTIONS cache-index)))
          ;; invalidate all cache when the timestamp of this file has changed
          []
          ;; compare each cache key
