You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Pascal Sancho (JIRA)" <ji...@apache.org> on 2014/02/14 13:44:20 UTC

[jira] [Comment Edited] (FOP-2342) Make image from URL abide no-cache HTTP headers

    [ https://issues.apache.org/jira/browse/FOP-2342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13901391#comment-13901391 ] 

Pascal Sancho edited comment on FOP-2342 at 2/14/14 12:43 PM:
--------------------------------------------------------------

FOP caches images, and that cache is based on their URI.
You can disable such cache as said there:
[1] http://xmlgraphics.apache.org/fop/1.1/graphics.html#caching

If that doesn't help you, feel free to repoen this issue.


was (Author: psancho):
FOP caches images, and that cache is based on its URI.
You can disable such case as said there:
[1] http://xmlgraphics.apache.org/fop/1.1/graphics.html#caching

If that doesn't help you, feel free to repoen this issue.

> Make image from URL abide no-cache HTTP headers
> -----------------------------------------------
>
>                 Key: FOP-2342
>                 URL: https://issues.apache.org/jira/browse/FOP-2342
>             Project: Fop
>          Issue Type: Improvement
>          Components: images
>    Affects Versions: 1.1
>         Environment: Tested on CentOS, Tomcat6 and FOP 1.1rc1 service
>            Reporter: The BitSmith
>            Priority: Minor
>              Labels: http-headers, image
>
> When I include an image, it is cached. So including a dynamic image shows only the first version of the image. To prevent this, I have to add a constantly changing parameter (called "nonce" here):
>  <fo:external-graphic width="140mm" height="30mm" content-width="scale-down-to-fit" content-height="scale-down-to-fit" inline-progression-dimension.maximum="100%" scaling="uniform" vertical-align="-50%">
> <xsl:variable name="orgguid" select="Organization/ID" />
> <xsl:variable name="nonce" select="Nonce" />
> <xsl:variable name="logo" select="concat('http://localhost/images/fopimages/logo.php?orgid=', $orgguid, '&amp;dummy=', $nonce)"/>
> <xsl:attribute name="src">url(<xsl:value-of select="$logo"/>)</xsl:attribute>
> </fo:external-graphic>
> This happens despite the fact that the PHP script that produces the image sends "no-cache" headers (PHP code):
> header('Expires: Fri, 13 May 1983 18:30:00 GMT');
> header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
> header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
> header('Cache-Control: post-check=0, pre-check=0', FALSE);
> header('Pragma: no-cache'); // HTTP/1.0
> header('Content-Type: ' . $this->mstrLogoType);
> header('Content-Length: ' . strlen($this->mmixLogoData));
> header('Content-Disposition: inline');
> header('X-Content-Type-Options: nosniff'); // Workaround for IE bug.
> echo $this->mmixLogoData;
> It would be nice if the image caching mechanism would abide these headers, so workarounds like extra parameters are not necessary.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)