<commit_before><?php

namespace Ilios\WebBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class IndexController extends Controller
{
    public function indexAction()
    {
        $file = $this->get('iliosweb.assets')->getIndex();
        if (!$file) {
            throw new \Exception('Unable to retrieve the index file');
        }
        $response = new Response($file);
        $response->headers->set('Content-Type', 'text/html');

        $response->setPublic();
        $response->setMaxAge(60);
<commit_msg>Use redis method to distribute index.html file<commit_after><?php

namespace Ilios\WebBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class IndexController extends Controller
{
    public function indexAction()
    {

        $file = $this->get('iliosweb.redisindex')->getIndex('current-content');
        if (!$file) {
            throw new \Exception('Unable to retrieve the index file');
        }

        $response = new Response($file);
        $response->headers->set('Content-Type', 'text/html');

        $response->setPublic();
        $response->setMaxAge(60);

{'fraction_non_alphanumeric': 0.13344051446945338, 'fraction_numerical': 0.003215434083601286, 'mean_word_length': 3.337979094076655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '3865162', 'n_tokens_mistral': 340, 'n_tokens_neox': 335, 'n_words': 72}