Skip to content

v2.3.0: Implemented caching to GET methods

Compare
Choose a tag to compare
@Andre601 Andre601 released this 24 Aug 16:05
· 831 commits to master since this release

This version implements caching for the different get methods (e.g. getBotlists(String)).
This is used as a sort of ratelimit prevention as the requested data is kept in cache and used for 2 minutes before a new request is made.

Additional changes are:

  • getBotlists() and getBotlist(String|Site) now have an additional String parameter used for the cache.
    So the new methods are getBotlists(String) and getBotlist(String, String|Site)
  • The JSON used for post requests is no longer a single main field, making this version more thread save.
  • You can disable the caching through the RequestHandler (Although it's not recommended).
    • To do this just add the boolean true when making an instance of the RequestHandler.
      Example: RequestHandler handler = new RequestHandler(true);
    • This was suggested by @DavidRockin

Installation

Gradle

repositories{
    jcenter()
}

dependencies{
    compile group: 'com.andre601', name: 'JavaBotBlockAPI', version: '2.3.0'
}

Maven

<repositories>
  <repository>
    <id>jcenter</id>
    <url>https://dl.bintray.com/andre601/maven</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>com.andre601</groupId>
    <artifactId>JavaBotBlockAPI</artifactId>
    <version>2.3.0</version>
  </dependency>
</dependencies>