diff --git a/src/Go/Instrument/Transformer/FilterInjectorTransformer.php b/src/Go/Instrument/Transformer/FilterInjectorTransformer.php
index <HASH>..<HASH> 100644
--- a/src/Go/Instrument/Transformer/FilterInjectorTransformer.php
+++ b/src/Go/Instrument/Transformer/FilterInjectorTransformer.php
@@ -92,6 +92,11 @@ class FilterInjectorTransformer implements SourceTransformer
      */
     public static function rewrite($resource)
     {
+        // If cache is disabled, then use on-fly method
+        if (!self::$rewriteToPath) {
+            return self::PHP_FILTER_READ . self::$filterName . "/resource=" . $resource;
+        }
+
         $relativeToRoot = stream_resolve_include_path($resource);
         if (strpos($relativeToRoot, self::$rootPath) === 0) {
             $relativeToRoot = substr($relativeToRoot, strlen(self::$rootPath));
Fix error when cache directory is not available. Need to configure debug/prod mode later for this