Giter VIP home page Giter VIP logo

Comments (4)

manuelwaldner avatar manuelwaldner commented on September 16, 2024 1

If you look into the Constructor of the L4J8 class you see, that there is a line which sets the CacheProvider of the DataCall.class.
I dont have much time right now, but maybe you can figure it out yourself if you inspect the DataCall code and the CacheProvider etc.

from r4j.

manuelwaldner avatar manuelwaldner commented on September 16, 2024 1

I looked into my code and here is a short example how to use a FileSystemCacheProvider with custom TimeToLive times for specific endpoints.

L4J8 l4j8 = new L4J8(SecretFile.CREDS);
FileSystemCacheProvider cacheProvider = new FileSystemCacheProvider(getFilesDir().resolve(L4J8_CACHE_DIR));
CacheLifetimeHint hints = new CacheLifetimeHint();
hints.add(URLEndpoint.V3_CHAMPION_ROTATIONS, TimeUnit.DAYS.toMillis(7L)); // 1 week
cacheProvider.setTimeToLive(hints);
DataCall.setCacheProvider(cacheProvider);

from r4j.

stelar7 avatar stelar7 commented on September 16, 2024 1

The memory cache is kinda wonky at the moment, and does not support the cache hints properly.
As for how to set the TTL, see the comment above from manuelwaldner.

The default values are shown here https://github.com/stelar7/L4J8/blob/a639248e2509b91aee1cb64c493c4982881d24b0/src/main/java/no/stelar7/api/l4j8/basic/cache/CacheLifetimeHint.java#L38-L65

from r4j.

stelar7 avatar stelar7 commented on September 16, 2024 1

I have a fix for the memory cache in the works, but no ETA. Most likely late October...

from r4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.