<commit_before><?php

// Create container
$app = new \Slim\App(["settings" => $config]);
$container = $app->getContainer();
$app->add(new \Slim\HttpCache\Cache('public',7200));

// Register component Http-cache
$container['cache'] = function () {
    return new \Slim\HttpCache\CacheProvider();
};

// Default generate eTag per 5minutes
$container['etag'] = function(){
    $fix = date('Y-m-d H:');
    $rate = date('i');
    $maxminute = 60;
    $intervalminute = 5;

    $n=0;
    for ($i = 0; $i <= $maxminute; $i+=$intervalminute) {
        if($i<=$rate) {$n++;}
    }
    return md5($fix.$n);
};

// Default generate eTag per 30minutes
$container['etag30min'] = function(){
    $fix = date('Y-m-d H:');
    $rate = date('i');
    $maxminute = 60;<commit_msg>- Set public cache default to 1 week<commit_after><?php

// Create container
$app = new \Slim\App(["settings" => $config]);
$container = $app->getContainer();
$app->add(new \Slim\HttpCache\Cache('public',604800));

// Register component Http-cache
$container['cache'] = function () {
    return new \Slim\HttpCache\CacheProvider();
};

// Default generate eTag per 5minutes
$container['etag'] = function(){
    $fix = date('Y-m-d H:');
    $rate = date('i');
    $maxminute = 60;
    $intervalminute = 5;

    $n=0;
    for ($i = 0; $i <= $maxminute; $i+=$intervalminute) {
        if($i<=$rate) {$n++;}
    }
    return md5($fix.$n);
};

// Default generate eTag per 30minutes
$container['etag30min'] = function(){
    $fix = date('Y-m-d H:');
    $rate = date('i');
    $maxminute = 60;
{'fraction_non_alphanumeric': 0.21598968407479047, 'fraction_numerical': 0.02385557704706641, 'mean_word_length': 3.472622478386167, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4859142', 'n_tokens_mistral': 579, 'n_tokens_neox': 546, 'n_words': 126}