-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Add file downloader cache to make faster the library/boards manager #9023
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
Conversation
4b52a98
to
980df58
Compare
980df58
to
d089323
Compare
I did a test using a throwaway Boards Manager JSON file I published here:
But with build 871 I get this:
Note the error message now says "The process cannot access the file because it is being used by another process." instead of "Received invalid http status code from server: 404". C:\Users\per\AppData\Local\Arduino15\staging\packages\MicroCore-1.0.4.tar.bz2 didn't exist on my computer before the installation attempt. It is a 0 byte file that was created during the installation. The error message "The process cannot access the file because it is being used by another process." makes me think of a conflict with an antivirus software's on-access file scanner, but this is not the case because I tried with the antivirus disabled and it still happens. I feel like this error message could be very misleading to someone trying to troubleshoot this problem because it acts as a distraction from the real problem that the file couldn't be downloaded, and also blocks the helpful HTTP response code from being shown. I also tried with build 871 running in portable mode, with the same error message. On my Linux machine, I get the "Received invalid http status code from server: 404" error from build 871. |
- The file will be close before delete it - Some refactoring of the downloader cache
@ArduinoBot build this please |
I should fix the problem but I can't test on windows, could you test it ? @per1234 |
@mattiabertorello looks good. Thanks! |
Does this solve #6333? |
f21584b
to
a7d395f
Compare
@ArduinoBot build this please |
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-9023-BUILD-873-linux32.tar.xz ℹ️ The |
@feikname yes, this PR should address also your issue. edit : changed build download link due to some bugfixing |
Add the possibility to configure them `http.max_redirect_number`
and will be downloaded only one time
@per1234 consider the signature whitelisting a foundation for implementing in near future a 3rd party indexes security mechanism without breaking retro-compatibility. Currently the signature check mechanism uses a public and private keys and consists in signing the Arduino's package_index.json server side with our private key, and checking the signature in the IDE using the Arduino's public key bundled in the IDE. We are investigating in ways to make more secure also 3rd party cores indexes, maybe starting using our own key end ending up having some sort of CA mechanism similar to the one used by web browsers. But this is not so easy to implement so we implemented only the first bits of the feature. I hope that this clarifies your doubts, otherwise, feel free to ask for details :) |
eb143bd
to
425affe
Compare
425affe
to
1bfdf83
Compare
Germany. Same error https://downloads.arduino.cc/packages/package_index.json.sig file signature verification failed. File ignored. |
024dab7
to
8b90f1a
Compare
8b90f1a
to
85e91ef
Compare
34073d7
to
636f930
Compare
@ArduinoBot build this please |
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-9023-BUILD-885-linux32.tar.xz ℹ️ The |
…E 1.8.10 arduino/Arduino#9023 changed the Arduino IDE CLI's output. Due to this, when no boardsmanager.additional.urls preference is set, the output from Arduino IDE 1.8.10 (and onwards likely) caused priorBoardsmanagerAdditionalURLs to be set to "Set log4j store directory /home/travis/.arduino15". The solution was to check the exit status of the arduino --get-pref command and if it is 4 (Preference passed to --get-pref does not exist), overwrite the spurious value.
http.connection_timeout_ms
with 5000 as a default value,cache.enable
with true as a default valueFixed issues: #8936, #6333, #7690 (comment)
Mitigated: #8988
The cache will consider the "Cache-Control" and the ETag headers.
So if the server delivers a file, setting a
Cache-Control="private, max-age=14400"
http header, the file will be cached for 4 hours without make any http request. When the cached file expires the download will make a HEAD request to check for ETag header changes, before making an actual download request.Trying to emulate the browser behavior: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching
The metadata of the cached files will be store in the Arduino15/cache/cache.json
example: