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

jscad.app fantasizes design for non-existing URL #84

Closed
Hermann-SW opened this issue Jan 19, 2024 · 7 comments
Closed

jscad.app fantasizes design for non-existing URL #84

Hermann-SW opened this issue Jan 19, 2024 · 7 comments

Comments

@Hermann-SW
Copy link
Contributor

I worked on Raspberry Pi5 before, switched to Linux on x86_64 laptop.

This file does not exist:
https://stamm-wilbrandt.de/en/forum/C36_10.correct.jscad

Proof on server:

$ ssh [email protected]
[email protected]'s password: 
Last failed login: Fri Jan 19 11:44:51 CET 2024 from ip-109-193-006-010.um39.pools.vodafone-ip.de on ssh:notty
There was 1 failed login attempt since the last successful login.
-chrootsh-4.2$ ls -l httpdocs/forum/en/C36_10*
ls: cannot access httpdocs/forum/en/C36_10*: No such file or directory
-chrootsh-4.2$ 

openjscad.xyz errors out as it should:
https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/C36_10.correct.jscad

jscad.app shows a model for that URL:
https://jscad.app/#https://stamm-wilbrandt.de/en/forum/C36_10.correct.jscad

The model displayed is one I created, but not under that name.
New OS, new browser (chrome this time), so it cannot be a problem of local browser cache.

Does jscad.app fantasize?
If so, can that be turned off please?

@hrgdavor
Copy link
Owner

@Hermann-SW best solution would be to setup CORS headers, so jscad.app can run them by using browser download.

Since you do not have correct CORS headers, jscad.app uses fallback proxy, that is hosted on some cloud provider. There is obviously some heavy caching in that cloud service.

@platypii could you look into it ?

@Hermann-SW
Copy link
Contributor Author

Hermann-SW commented Jan 20, 2024

@hrgdavor
Thanks, I tested with this new gist and curl:
https://gist.github.com/Hermann-SW/ef1ceade4aa53412585e42b6c5122354

Different to one of your previous postings on CORS
jscad/OpenJSCAD.org#1318 (comment)

only one "*allow*" header is returned by the raw gist (access-control-allow-origin: *).

@hrgdavor
Copy link
Owner

@Hermann-SW cache is now turned off for the proxy script by @platypii . Try again, I did, and now it shows error correctl, instead of old cached file. This will also be useful if file changes from time to time, so ppl get fresh version.

@hrgdavor
Copy link
Owner

only one "allow" header is returned by the raw gist (access-control-allow-origin: *).

there is a special pre-flight request that browser is not showing you. And also I copied .htaccess example from somewhere, and it worked for me. I did not try to minimize it.

@Hermann-SW
Copy link
Contributor Author

Hermann-SW commented Jan 20, 2024

@hrgdavor
Thanks, same here, jscad.app now reports:

Error: failed to load script from url https://stamm-wilbrandt.de/en/forum/C36_10.correct.jscad

@Hermann-SW
Copy link
Contributor Author

Hermann-SW commented Jan 20, 2024

Just one last comment, I experimented with gist and cache control.
To reference latest version, no commit hash should be in URL:
https://gist.github.com/Hermann-SW/ef1ceade4aa53412585e42b6c5122354?permalink_comment_id=4841174#gistcomment-4841174

max-age=300 for raw gist cannot be lowered.
So workflow to publish JSCAD gist is:

  1. publish change
  2. wait 5min
  3. post somewhere mentioning the URL, and everyone is guaranteed to see latest version

More details:
https://gist.github.com/Hermann-SW/ef1ceade4aa53412585e42b6c5122354?permalink_comment_id=4841245#gistcomment-4841245

@hrgdavor
Copy link
Owner

@Hermann-SW thank you for the research, and the insights, I will add those findings somewhere in readme for others to see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants