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
CodeFrame does not cache p5 library in service worker or browser cache on Chromium #213
Labels
Comments
howard-e
added a commit
that referenced
this issue
Apr 23, 2024
…5.min.js. Avoids requiring a cached version of script by passing the text content of the script directly to the iframe.
Mostly fixed but leaving it open as this is still an issue with embeds that asynchronously load their code assets (ie |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Chromium browsers do not cache the p5 library used for examples. This is a limitation on the use of iframes with a srcdoc attribute on Chromium as documented here. As a result, pages like the arc() reference download the p5 library for each example. This happens regardless of service worker scope, origin, etc as far as I can tell. This does not happen on Firefox or Safari.
Some solution using iframe and srcdoc may exist that I do not see but afaik there are two possible approaches from here:
src
attribute of the iframe ala_arc_reference_example_1.html
. This is similar to what happens on the current p5 sites's example pages.I believe that 2 is cleaner but I am open to alternatives. I think that the equivalent code from the current p5 website is here.
Potentially useful links:
The text was updated successfully, but these errors were encountered: