Cache more things, add page speed to README

Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
Skylar "The Cobra" Widulski 2023-12-14 18:04:09 -05:00
parent ee6a512b47
commit f261baf9a3
Signed by: cobra
GPG Key ID: 4FD8F812083FF6F9
2 changed files with 18 additions and 4 deletions

View File

@ -44,10 +44,18 @@ The following are optional.
`GUMBO_LIBXML_LOCATION` - Path to `libgumbo_xml.so` (default `./gumbo-libxml/.libs/libgumbo_xml.so`, can be edited to `libgumbo_xml`, which does the same thing as `libxml2` in `LIBXML2_LOCATION`)
# Performance
## Local
RAM usage maxes out below 200 MiB (162 in production testing, different from local, which was around 95 MiB).
## Hardware
RAM usage seems to max out below 150 MiB (134 in production testing, different from local, which was around 65 MiB).
## Page
Due to the nature and method of proxying images, the performance on first load is poor (PageSpeed Inisghts speed index of 2.5s).
After the first load, though, your browser's cache control should kick in, and any subsequent requests for an image are cached.
Altogether, the performance listed on PageSpeed Insights is 63.
# Todo
* Speed up image proxying somehow
* Video list page*
* Video page*
* User page (it is internally linked)

View File

@ -41,11 +41,17 @@
(cond
((equal? path "/style.css")
(display ";\tHandler: internal") (newline)
(values '((content-type . (text/css)))
(values '((content-type . (text/css))
(cache-control .
,(parse-header 'cache-control
"max-age=604800")))
(call-with-input-file "static/style.css" get-string-all)))
((equal? path "/favicon.png")
(display ";\tHandler: internal") (newline)
(values '((content-type . (image/png)))
(values '((content-type . (image/png))
(cache-control .
,(parse-header 'cache-control
"max-age=604800")))
(call-with-input-file "static/logo.png" get-bytevector-all)))
((equal? path "/proxy")
(proxy-page (uri-query uri)))