diff --git a/print_pdf/print_pdf.pages.inc b/print_pdf/print_pdf.pages.inc
index ca04759..6c0c261 100644
--- a/print_pdf/print_pdf.pages.inc
+++ b/print_pdf/print_pdf.pages.inc
@@ -143,9 +143,15 @@ function print_pdf_generate_path($path, $query = NULL, $cid = NULL, $pdf_filenam
 
     $pdf = '';
     $cachemiss = FALSE;
-    if ($cache_enabled && isset($node->nid)) {
+    if ($cache_enabled) {
+      if (isset($node->nid)) {
+        $cached_file_name = $node->nid;
+      }
+      else {
+        $cached_file_name = str_replace('/', '_', $node->path);
+      }
       // See if the file exists in the cache
-      $cachefile = drupal_realpath(print_pdf_cache_dir()) . '/' . $node->nid . '.pdf';
+      $cachefile = drupal_realpath(print_pdf_cache_dir()) . '/' . $cached_file_name . '.pdf';
       if (is_readable($cachefile)) {
         // Get the PDF content from the cached file
         $pdf = file_get_contents($cachefile);
