How can I clean cached include files on plantuml-server?

0 votes
asked May 23, 2021 in Question / help by kirchsth (4,880 points)
retagged May 25, 2021 by kirchsth

I changed my C4.puml implementation but if I open the diagram in PlantUML-Server it still displays the old diagram with the old/cached C4.puml file. How can I clean the cache on the PlantUML-Server? (the cache is older >1 day!)
Thank you and best regards
Helmut

e.g. in following [cached] png version the legend is violet

http://www.plantuml.com/plantuml/png/bLFlJzim4FtEN-5b-n0qri1-26aI4bL1OrBPEWhY8xhOryJ3iIEVKzX_lxFJabAwJVlaoFVkthtdbrCAu4FNcBrNsahJAHHr22rzBWeF3wDAXxehEq8ldGremqYwfhZNNjOKwcBoyTtCW0qtbzC27xckKF7btOJ1e2twKHj7xusLEZVOSFyrL7csF1eTPWVYJUcyGZznnlcJxBKw_d3u_ZZRtu4-YkW53_qNjWHvtxLRQEV1LiZWYBv2iuKC-BY5v4l3sxzedw4dP_Denu789Xq5rw1dU3P3rneKeOOWBA8IhNUgau6uRTK5gj6MeUDuQWeUWdlH2qCHYQ_mQP1OQaWN5Xz4j4JmIxJEid9AAg2Ya-GLKpxvdrCBJ36VZICJw-WC9D9hdjGmH6WRq2z0zWia1haIrjSWaZzm3j86wUaswGwtwSQREiLkPjZqu7zNM1lm5zNGwhZ1x6ia_0bBYES5M6MG11WZED8C91B6LLgAF6P_D5YRiapQMTf_BlRjDjLPcQkIXvz1W1888z6bbjwHMmGn_p5DpCueMh_aWKYf5xmDgriwBP7FXVCD16PyhiFBMYynQkc_ilZPAHtYufMsLRoOiuciwvFuXU27CAmZpi7bqAzIs-VXXf1YP_hL6H3hgSB6xIxVNVMc9h5N28gAMwy3hihhT0_llvDZAF-PQDeJ3T8JJu8rI0GLxfGul_X-UpSz_tB-xIpVtpj5gxh6_0O0

But if I use the svg version of the same link it displays the correct khaki colors in the diagram (it was never used with old version).
http://www.plantuml.com/plantuml/svg/bLFlJzim4FtEN-5b-n0qri1-26aI4bL1OrBPEWhY8xhOryJ3iIEVKzX_lxFJabAwJVlaoFVkthtdbrCAu4FNcBrNsahJAHHr22rzBWeF3wDAXxehEq8ldGremqYwfhZNNjOKwcBoyTtCW0qtbzC27xckKF7btOJ1e2twKHj7xusLEZVOSFyrL7csF1eTPWVYJUcyGZznnlcJxBKw_d3u_ZZRtu4-YkW53_qNjWHvtxLRQEV1LiZWYBv2iuKC-BY5v4l3sxzedw4dP_Denu789Xq5rw1dU3P3rneKeOOWBA8IhNUgau6uRTK5gj6MeUDuQWeUWdlH2qCHYQ_mQP1OQaWN5Xz4j4JmIxJEid9AAg2Ya-GLKpxvdrCBJ36VZICJw-WC9D9hdjGmH6WRq2z0zWia1haIrjSWaZzm3j86wUaswGwtwSQREiLkPjZqu7zNM1lm5zNGwhZ1x6ia_0bBYES5M6MG11WZED8C91B6LLgAF6P_D5YRiapQMTf_BlRjDjLPcQkIXvz1W1888z6bbjwHMmGn_p5DpCueMh_aWKYf5xmDgriwBP7FXVCD16PyhiFBMYynQkc_ilZPAHtYufMsLRoOiuciwvFuXU27CAmZpi7bqAzIs-VXXf1YP_hL6H3hgSB6xIxVNVMc9h5N28gAMwy3hihhT0_llvDZAF-PQDeJ3T8JJu8rI0GLxfGul_X-UpSz_tB-xIpVtpj5gxh6_0O0

commented May 24, 2021 by kirchsth (4,880 points)
commented May 25, 2021 by kirchsth (4,880 points)
edited May 28, 2021 by kirchsth

I checked the source, could it be that there is an automatic cache of 5 days if the url>35 character (independet of the referenced !include files),
@plantuml: can this be the problem?

Thank you and best regards
Helmut

plantuml/plantuml-server
src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java

        if (StringUtils.isDiagramCacheable(uml)) {
            addHeaderForCache(blockUml);
        }

plantuml/plantuml
src/net/sourceforge/plantuml/StringUtils.java

    public static boolean isDiagramCacheable(String uml) {
        if (uml.length() < 35) {
            return false;
        }
        return true;
}

plantuml/plantuml-server
src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java

  public void addHeaderForCache(HttpServerResponse response, String data) {
    long today = System.currentTimeMillis();
    final int maxAge = 3600 * 24 * 5;
    // Add http headers to force the browser to cache the image
    response.putHeader(HttpHeaders.EXPIRES, String.valueOf(today + 1000L * maxAge));

commented May 28, 2021 by kirchsth (4,880 points)
Cache expired after 5 days, correct diagram is displayed

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...