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

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 `/spring_evals` 路由開始,在進行任何變更之前先查看 #169 的狀態,因為 issue 作者打算等待該問題獲得處理。在那裡評估 flask-optimize 整合,檢查回應是否仍然正確,以及其大小和載入時間是否比回報的 403 KB 和六秒基準有所改善。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
flask, python
領域
backend, performance
Issue 類型
功能
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。