Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cachebusters to CSS and JS #228

Merged
merged 1 commit into from
Dec 16, 2023
Merged

Add cachebusters to CSS and JS #228

merged 1 commit into from
Dec 16, 2023

Conversation

SquidDev
Copy link
Collaborator

@SquidDev SquidDev commented May 13, 2023

Just adds a ?v=filehash to the CSS and JS files. This does not apply to Agda-only files (so those using the "code" template), but I think that's probably fine for now.

This does massively increase build times when changing CSS. It looks like some markdown files are taking >5 seconds to be converted. I'm not sure why this is, want to do some profiling before merging.

@SquidDev SquidDev added the web For issues/pull requests relating to the 1lab website itself. label May 13, 2023
@SquidDev
Copy link
Collaborator Author

Adding a couple of timedM calls, shows we're spending a lot more time rendering Markdown than I'd expect.

Label Time (s)
Check markup 0.71
Fix markup 4.12
Parse Markdown 4.25
Patch markdown 0.46
Render Markdown 21.25
Search 0.29
Write file 2.77
patchInline 0.46
patchInlines 0.36
uncommentAgda 0.32

Not sure why this is - I'd expect Pandoc to be relatively sensible here. Might try to see if we can build a profiling build of 1lab.

@SquidDev SquidDev marked this pull request as ready for review June 3, 2023 10:22
@SquidDev
Copy link
Collaborator Author

SquidDev commented Jun 3, 2023

After some profiling, most of the time was being spent inside Skylighting (I was running with --skip-agda). I've patched Skylighting to pre-compute the regexes, ensuring they're cached between code blocks, which brings the total build time down to ~7s (from ~15s) - not ideal, but I think workable now.

Not 100% wild about the maintainability of this - I will submit this patch to upstream, so we may want to wait if/until that is merged.

@SquidDev SquidDev force-pushed the feature/cache-buster branch 2 times, most recently from e5cb686 to be7857d Compare September 12, 2023 13:34
Copy link

Rendered preview

@plt-amy plt-amy merged commit e9cb850 into main Dec 16, 2023
5 checks passed
@plt-amy plt-amy deleted the feature/cache-buster branch December 16, 2023 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web For issues/pull requests relating to the 1lab website itself.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants