ComputerScienceHouse / ComputerScienceHouse/conditional
Minify HTML to Reduce Load time and Data
- Ngôn ngữ chính
- Python
- Star
- 12
- Fork
- 39
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
# 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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu tại route `/spring_evals` và xem trạng thái của #169 trước khi thay đổi bất kỳ điều gì, vì tác giả issue dự định chờ việc đó. Đánh giá tích hợp flask-optimize tại đó, kiểm tra rằng response vẫn chính xác và kích thước cùng thời gian tải của nó được cải thiện so với mức cơ sở được báo cáo là 403 KB và sáu giây.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- flask, python
- Lĩnh vực
- backend, performance
- Loại issue
- Tính năng
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 25/100