             (do (io/make-parents cache-index-file)
                 {}))
 
+        cache-options
+        (->> cache-affecting-options
+             (map #(get-in state %))
+             (into []))
+
         cache-files
-        (if (not= SHADOW-CACHE-KEY (:SHADOW-CACHE-KEY cache-index))
+        (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

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

             (SourceMap$LocationMapping. resource-name (.getAbsolutePath file)))
           (into [])))))

(def cache-affecting-options
  [[:compiler-options :source-map-use-fs-paths]
   [:compiler-options :rewrite-polyfills]
   [:js-options]])

(defn convert-sources*
  "takes a list of :js sources and rewrites them to using closure
   partial compiles must supply the cached sources so closure doesn't complain about things
