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

From: Kirch Fritz <Friedrich.Kirch_at_ADDRESS_REMOVED>
Date: Thu Aug 13 2020 - 08:37:59 PDT

Hello Alexey,

this is my LOG-File

12.08.2020-08:56:28.017 INFO [REST-71] => it2m6026.it2mbizz.de GET /mr/v01/~~~120/mediafile/id/20021211/filetype/pdf?mimetype=true
12.08.2020-08:56:28.017 TRACE [REST-71] => Headers: {User-Agent=[Java/1.8.0_261], Connection=[keep-alive], Host=[mre12.it2media.de:8081], Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]}
12.08.2020-08:56:28.019 INFO [REST-71] get "mga_20021211_pdf.pdf" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze
12.08.2020-08:56:28.019 TRACE [REST-71] lock "mga_20021211/120/READ" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze
12.08.2020-08:56:28.027 INFO [REST-71] <= [200-OK] it2m6026.it2mbizz.de GET /mr/v01/~~~120/mediafile/id/20021211/filetype/pdf?mimetype=true
12.08.2020-08:56:28.027 TRACE [REST-71] <= Headers: {Content-Type=[application/pdf], Content-Disposition=[inline; filename=mga_20021211.pdf], filename=[mga_20021211.pdf], Accept-Ranges=[none], Connection=[close], Last-Modified=[Mon, 23 Sep 2019 15:15:17 CEST], Cache-Control=[must-revalidate], Expires=[Wed, 12 Aug 2020 08:56:33 CEST], Content-Length=[4355282], Content-Range=[bytes 0-4355281/4355282]}
12.08.2020-08:56:28.027 TRACE [REST-71] <= Content-Length: 4355282
12.08.2020-08:56:28.027 TRACE [REST-71] <= Entity:
***
de.it2m.tel.mr.plugin.impl.network.MediaFileStreamer@75501588
***
12.08.2020-08:56:28.372 TRACE [REST-71] unlock "mga_20021211/120/READ" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze
12.08.2020-08:56:28.414 INFO [REST-71] => it2m6026.it2mbizz.de GET /mr/v01/~~~120/mediafile/id/20021211/filetype/pdf?mimetype=true
12.08.2020-08:56:28.414 TRACE [REST-71] => Headers: {User-Agent=[Java/1.8.0_261], Connection=[keep-alive], Host=[mre12.it2media.de:8081], Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]}
12.08.2020-08:56:28.415 INFO [REST-71] get "mga_20021211_pdf.pdf" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze
12.08.2020-08:56:28.415 TRACE [REST-71] lock "mga_20021211/120/READ" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze
12.08.2020-08:56:28.418 INFO [REST-71] <= [200-OK] it2m6026.it2mbizz.de GET /mr/v01/~~~120/mediafile/id/20021211/filetype/pdf?mimetype=true
12.08.2020-08:56:28.418 TRACE [REST-71] <= Headers: {Content-Type=[application/pdf], Content-Disposition=[inline; filename=mga_20021211.pdf], filename=[mga_20021211.pdf], Accept-Ranges=[none], Connection=[close], Last-Modified=[Mon, 23 Sep 2019 15:15:17 CEST], Cache-Control=[must-revalidate], Expires=[Wed, 12 Aug 2020 08:56:33 CEST], Content-Length=[4355282], Content-Range=[bytes 0-4355281/4355282]}
12.08.2020-08:56:28.418 TRACE [REST-71] <= Content-Length: 4355282
12.08.2020-08:56:28.418 TRACE [REST-71] <= Entity:
***
de.it2m.tel.mr.plugin.impl.network.MediaFileStreamer@1483b753
***
12.08.2020-08:56:28.756 TRACE [REST-71] unlock "mga_20021211/120/READ" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze
12.08.2020-08:56:29.042 INFO [REST-71] => it2m6026.it2mbizz.de GET /mr/v01/~~~120/mediafile/id/20021211/filetype/pdf?mimetype=true
12.08.2020-08:56:29.042 TRACE [REST-71] => Headers: {User-Agent=[Java/1.8.0_261], Connection=[keep-alive], Host=[mre12.it2media.de:8081], Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]}
12.08.2020-08:56:29.043 INFO [REST-71] get "mga_20021211_pdf.pdf" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze
12.08.2020-08:56:29.043 TRACE [REST-71] lock "mga_20021211/120/READ" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze
12.08.2020-08:56:29.047 INFO [REST-71] <= [200-OK] it2m6026.it2mbizz.de GET /mr/v01/~~~120/mediafile/id/20021211/filetype/pdf?mimetype=true
12.08.2020-08:56:29.047 TRACE [REST-71] <= Headers: {Content-Type=[application/pdf], Content-Disposition=[inline; filename=mga_20021211.pdf], filename=[mga_20021211.pdf], Accept-Ranges=[none], Connection=[close], Last-Modified=[Mon, 23 Sep 2019 15:15:17 CEST], Cache-Control=[must-revalidate], Expires=[Wed, 12 Aug 2020 08:56:34 CEST], Content-Length=[4355282], Content-Range=[bytes 0-4355281/4355282]}
12.08.2020-08:56:29.047 TRACE [REST-71] <= Content-Length: 4355282
12.08.2020-08:56:29.047 TRACE [REST-71] <= Entity:
***
de.it2m.tel.mr.plugin.impl.network.MediaFileStreamer@59d6da1c
***
12.08.2020-08:56:29.390 TRACE [REST-71] unlock "mga_20021211/120/READ" : ropool/120@it2m6026.it2mbizz.de:AU6PZetOze

It shows 3 requests each answered by 200 - OK

On our server side, we also support HTTP status 304 - Not Modified.
However, the client would also have to send the If-Modified-Since header.
We can only check whether the image has been updated in the meantime if this header is sent by the client.
If not, we send the HTTP status 304 - Not Modified back to the client.
In the above requests from RenderX, however, the If-Modified-Since header is not sent in the request!

Fritz

-----Ursprüngliche Nachricht-----
Von: Xep-support <xep-support-bounces@renderx.com> Im Auftrag von Alexey Medvedev
Gesendet: Donnerstag, 13. August 2020 01:37
An: xep-support@renderx.com
Betreff: [xep-support] Re: How often does XEP.BAT use my graphic-URL?

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
_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w ww.renderx.com/terms-of-service.html
_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html
Received on Thu Aug 13 08:38:29 2020

This archive was generated by hypermail 2.1.8 : Thu Aug 13 2020 - 08:39:00 PDT