[xep-support] Re: How often does XEP.BAT use my graphic-URL?

Alexey Medvedev amedvedev at renderx.com
Wed Aug 12 16:37:04 PDT 2020


I've tried Jetty(9.4.31.v20200723) and by default it sets Expires to 1 
Jan 1970 and serves an image for the first time and then "304 Not 
modified" for the 2nd, 3rd and 4th. Then I've configured Expires and now 
XEP hits the URL only once.

I've thought about "Cache-Control: must-revalidate" being the reason, 
but after checking with "must-revalidate" Wireshark still have shown 
only one request.

Please sniff the traffic(or see logs) to check if your Jetty returns 200 
four times or 200 + 304 thrice.
Also try the same with some simple jpg instead of pdf. It shouldn't 
matter as it's URLCache working(not ImageCache) and I've checked with 
simple pdf myself but better be sure.

How I have done it:
1) Downloaded latest Jetty as .zip
2) unziped it to .
3) added HeaderFilter to .\etc\webdefault.xml
<filter>
    <filter-name>HeaderFilter</filter-name>
<filter-class>org.eclipse.jetty.servlets.HeaderFilter</filter-class>
    <init-param>
      <param-name>headerConfig</param-name>
      <param-value>
       set X-Frame-Options: DENY,
       "add Cache-Control: no-cache, no-store, must-revalidate",
       setDate Expires: 31540000000,
       addDate Date: 0
      </param-value>
    </init-param>
  </filter>
  <filter-mapping>
     <filter-name>HeaderFilter</filter-name>
     <url-pattern>/*</url-pattern>
</filter-mapping>

4) placed resources to .\demo-base\webapps\ROOT\images
5) opened terminal in . and
cd demo-base
java -jar ../start.jar

Reference an image from .fo as <fo:external-graphic 
src="url('http://127.0.0.1:8080/3keX.jpg')"/>

-- 
Regards,
Alexey Medvedev
RenderX
---
www.renderx.com



More information about the Xep-support mailing list