               source-text
               (if expression? "Expression" "File")
               (merge
-                {:ns           @current-ns
-                 :source-map   false
-                 :verbose      (:verbose @app-env)
-                 :cache-source (fn [x cb]
-                                 #_(when (and path (:source x))
-                                     (js/PLANCK_CACHE path (:source x) nil))
-                                 (cb {:value nil}))}
-                (when expression?
+                {:ns         @current-ns
+                 :source-map false
+                 :verbose    (:verbose @app-env)}
+                (if expression?
                   {:context       :expr
-                   :def-emits-var true}))
+                   :def-emits-var true}
+                  (when (:cache-path @app-env)
+                    {:cache-source (fn [x cb]
+                                     (when (and (= "File" (:name x)) (:source x))
+                                       (let [source (:source x)
+                                             [file-namespace relpath] (extract-cache-metadata-mem source-text)]
+                                         (js/PLANCK_CACHE (cache-prefix-for-path relpath) source
+                                           (when file-namespace
+                                             (cljs->transit-json (get-in @st [:cljs.analyzer/namespaces file-namespace]))))))
+                                     (cb {:value nil}))})))
               (fn [{:keys [ns value error] :as ret}]
                 (if expression?
                   (when-not error

          (if source
            (case lang
              :clj (execute-source ["text" source] opts)
              :js (js/eval source))
            (handle-error (js/Error. (str "Could not load file " source-value)) false in-exit-context?))))
      (let [source-text source-value
            expression-form (and expression? (repl-read-string source-text))]

; file here is an alternate parameter denoting a filesystem path
(defn load [{:keys [name macros path file] :as full} cb]
  (if file
    (when-not (load-and-callback! file :clj :calculate-cache-prefix cb)
      (cb nil))
    (if (re-matches #"^goog/.*" path)
      (if-let [goog-path (get (closure-index-mem) name)]
