public static CachePolicy fromString(String val) {
        if (val == null) {
            return AVAILABILITY_PRIORITY;
        }
        for (CachePolicy policy : CachePolicy.values()) {
            if (policy.val.equals(val)) {
                return policy;
            }
        }
        throw new HttpException(HttpStatus.BAD_REQUEST, "Invalid cache policy: " + val);
    }
Prioritize cache hits over service availability. We will route request with cache flag to the same upstream.
Even if cache upstream is not available, we will retry request to the same upstream.
server/src/main/java/com/epam/aidial/core/server/data/cache/CachePolicy.java