[INTERLINKED-25] Optimize caching of dynamic CSS files
Referencing Issues
[INTERLINKED-22] Broadband exodus
Most web requests to InterLinked sites involve a second non-cached request for the CSS file:
issues.interlinked.us:443 REDACTED - - [17/Sep/2025:00:41:47 +0000] TLSv1.3 TLS_AES_256_GCM_SHA384 "GET / HTTP/1.1" 200 36093 "https://issues.interlinked.us/?create"
interlinked.us:443 REDACTED - - [17/Sep/2025:00:41:47 +0000] TLSv1.3 TLS_AES_256_GCM_SHA384 "GET /css/dynamic/style.css?cache=none&offset=8670 HTTP/1.1"
This was done intentionally when the site styling was written, since that CSS file is actually a dynamic script that can return different values. This would ensure cached styling was not used if, say, the user changed the theme in account settings.
We should figure out how to do this without the CSS request every time as that's highly inefficient. Query parameters should not be used since that will bypass the cache every time. However, we could maybe have one file for each theme that is basically a link to the script - this way, if the user changes themes, the CSS file will change, only downloading new CSS when needed.
We would need to use the "effective" theme, since for example the daylight theme alternates between light and dark.
Comments
You must be logged in to leave a comment.
9/17/2025 7:05 PM — InterLinked
This has been fixed by moving the dynamic logic to determine the theme out of the CSS script and into the script that includes the CSS script in webpages. This was needed to ensure it would cache properly, as the CDN will not cache content if cookies are sent for it (as was previously the case).