ComputerScienceHouse / ComputerScienceHouse/conditional

Minify HTML to Reduce Load time and Data

Aberta
#170 3 comentários 0 reações 0 responsáveis Ver no GitHub
discussion needed enhancement
Linguagem predominante
Python
Estrelas
12
Forks
39
Merge médio
1d 13h
PRs com merge (30d)
1

Descrição

# Why?
Currently the HTML returned from conditional is large and riddled with blank newlines. In fact if you go to `/spring_evals` the page request is 403 kb! This affects load time, and can affect users data usage when visiting the page on mobile data. Conditional is slow, mostly because of the LDAP calls, but we can make an effort to reduce load times on the client when possible.

# The Fix
We can use a library called [flask-optimize](https://github.com/sunary/flask-optimize) to deal with this at each request. When attaching it to that same `spring_evals` route, it was reduced from 403 kb to 9.5kb and load time was reduced by a full 6 seconds!

# Downsides
We add a new dependency, and may have to deal with adding a few ` `s. Honestly minimal imo

# Okay, so just fix it
I will. As soon as #169 is merged. It's a separate change and I don't want to group them together. There's also a chance for a conflict if I submit a second PR. I'll just wait for the sake of avoiding such conflicts

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Comece pela rota `/spring_evals` e verifique o status de #169 antes de alterar qualquer coisa, pois o autor da issue pretendia esperar por isso. Avalie a integração do flask-optimize nesse ponto, verificando se a resposta continua correta e se o tamanho e o tempo de carregamento melhoram em relação à linha de base relatada de 403 KB e seis segundos.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
flask, python
Domínio
backend, performance
Tipo de issue
Funcionalidade
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.