ComputerScienceHouse / ComputerScienceHouse/conditional

Minify HTML to Reduce Load time and Data

未关闭
#170 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
discussion needed enhancement
主要语言
Python
星标
12
派生
39
平均合并
1 天 13 小时
30 天内合并 PR
1

描述

# 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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。