The test to see if something is cacheable is backwards: it should assume do not cache unless explicitly allowed, rather than the other way.

We implemented the pdfview module, and our URLs of the form /node/12345/pdf render a beautiful PDF document. However, with boost, it also creates a cache file node/12345/pdf.html which then gets served up to the next viewer who requests the PDF view. The problem is that it gets served up as content-type text/html instead of application/pdf so it shows up as gibberish on the screen.

The hack-fix is to tell the function that decides if it is cacheable that it is not. The right fix is to make the cache file creator write files with proper extension based on the document type.

Index: boost.api.inc
===================================================================
--- boost.api.inc	(revision 182)
+++ boost.api.inc	(working copy)
@@ -30,6 +30,10 @@
   if ($path == 'rss.xml' || preg_match('!/feed$!', $path))
     return FALSE;
 
+  // don't cache the PDF from pdfview module
+  if (preg_match('!/pdf$!', $path))
+    return FALSE;
+
   // Don't cache comment reply pages
   if (preg_match('!^comment/reply!', $path))
     return FALSE;

Comments

mikeytown2’s picture

Status: Active » Closed (fixed)

Closing all 5.x issues; will only reevaluate if someone steps up #454652: Looking for a co-maintainer - 5.x

Reason is 6.x has 10x as many users as 5.x; also last 5.x dev was over a year ago. The 5.x issue queue needs to go.