Changeset 15741 in josm for trunk/src/org


Ignore:
Timestamp:
2020-01-20T23:18:40+01:00 (5 years ago)
Author:
simon04
Message:

HttpClient: use cache by default

This is in accordance with java.net.URLConnection#getDefaultUseCaches(java.lang.String)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r15423 r15741  
    6464    private final Map<String, String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
    6565    private int maxRedirects = Config.getPref().getInt("socket.maxredirects", 5);
    66     private boolean useCache;
     66    private boolean useCache = true;
    6767    private String reasonForRequest;
    6868    private String outputMessage = tr("Uploading data ...");
     
    614614
    615615    /**
    616      * Determines whether not to set header {@code Cache-Control=no-cache}
     616     * Determines whether not to set header {@code Cache-Control=no-cache}.
     617     * By default, {@code useCache} is true, i.e., the header {@code Cache-Control=no-cache} is not sent.
     618     *
    617619     * @return whether not to set header {@code Cache-Control=no-cache}
    618620     * @since 15229
     
    657659
    658660    /**
    659      * Sets whether not to set header {@code Cache-Control=no-cache}
     661     * Sets whether not to set header {@code Cache-Control=no-cache}.
     662     * By default, {@code useCache} is true, i.e., the header {@code Cache-Control=no-cache} is not sent.
    660663     *
    661664     * @param useCache whether not to set header {@code Cache-Control=no-cache}
Note: See TracChangeset for help on using the changeset viewer.