DevCraft Документации
EnglishGuides

Cache v1.0.0

When the SDK returns a stored response and when it goes to the network.

The cache directory is MYSHOWS_CACHE_DIR. Entry lifetime is MYSHOWS_CACHE_TTL in seconds.

A normal call checks the stored copy first. If the network is down and a copy exists, the method returns it.

$show = $client->shows()->getById(showId: 1);
$again = $client->shows()->getById(showId: 1);

forceRecheck: true skips the copy. Without a network such a call throws NetworkException.

try {
    $fresh = $client->shows()->getById(showId: 1, forceRecheck: true);
} catch (\DevCraftClub\MyShows\Exception\NetworkException $e) {
    // no network, a fresh response cannot be fetched
}

Methods that change user data clear related cache entries so the next show card does not show a stale check-in.