ComputerScienceHouse / ComputerScienceHouse/conditional

Minify HTML to Reduce Load time and Data

Ouverte
#170 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
discussion needed enhancement
Langage dominant
Python
Étoiles
12
Forks
39
Merge moyen
1 j 13 h
PR mergées (30 j)
1

Description

# 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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par la route `/spring_evals` et vérifiez l’état de #169 avant de modifier quoi que ce soit, puisque l’auteur de l’issue avait l’intention d’attendre sa résolution. Évaluez l’intégration de flask-optimize à cet endroit, en vérifiant que la réponse reste correcte et que sa taille ainsi que son temps de chargement s’améliorent par rapport à la référence indiquée de 403 KB et six secondes.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
flask, python
Domaine
backend, performance
Type d'issue
Fonctionnalité
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.