Project

General

Profile

Feature #1035

canonical URL for ndn.min.js

Added by Junxiao Shi almost 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Start date:
08/24/2013
Due date:
% Done:

0%

Estimated time:

Description

NDN-JS developers should maintain a web server and a NDN repo to host released versions of ndn.min.js.
Benefit: If a customer visits multiple web apps that use the same version of NDN-JS, the browser needs to download the library only once. If the library is served from ndn: protocol, nearby NDN routers will have the file in their cache. In addition, app developers don't have to serve ndn.min.js (100+ KB) themselves.
Similar services are jQuery CDN and Microsoft AJAX CDN.

#1

Updated by Junxiao Shi almost 7 years ago

duplicates 1013, sorry

#2

Updated by Jeff Thompson over 5 years ago

  • Assignee set to Jeff Thompson

Issue #1013 also suggests "There should be a Name component or metadata entry indicating which git commit does the hosted file correspond to." (Closing issue #1013 to keep only this issue open.)

#3

Updated by Jeff Thompson over 5 years ago

  • Status changed from New to In Progress
  • Assignee changed from Jeff Thompson to Alexander Horn

Alex H,

ndn.min.js is already in the Github repo, but we want an easy URL for it (and not explicitly Github). Can you add an HTTP alias so that named-data.net/ndn-js/ndn.min.js redirects to:

https://raw.githubusercontent.com/named-data/ndn-js/master/build/ndn.min.js

#4

Updated by Junxiao Shi over 5 years ago

Redirection is bad: PageSpeed will complain its bad performance.

Instead, host it on a server, set HTTP expiration to one month or longer, and change the filename for each version.
The server should also enable TLS.

#5

Updated by Alexander Horn over 5 years ago

  • Status changed from In Progress to Resolved

already set up.

it's pass through.

http://named-data.net/ndn-js/ndn.min.js is what is at https://raw.githubusercontent.com/named-data/ndn-js/master/build/ndn.min.js

Juxiao, what you say is technically accurate - however, operationally, redirection makes the most sense right now.

IE - None of us have time or resources to set up a special server for this.

#6

Updated by Junxiao Shi over 5 years ago

It seems that this is setup as a reverse proxy?

#7

Updated by Alexander Horn over 5 years ago

indeed - tho i can do a 303 if preferred ?

either way, this seems the fastest / best way to suit immediate need of a canonical URL for ndn.min.js

we will keep an eye to other solutions as infrastructure grows.

#8

Updated by Alex Afanasyev over 5 years ago

I think it is not exactly correct to allow people to include the hosted version of ndn.min.js into their pages. The main problem of this is that this inclusion can break their application, whenever we do a new release.

If we provide such link and recommend it to be used (which is kind of risky... without using a real CDN), we should at least include version number. Similar how it is done in jQuery case (http://jquery.com/download/)

#9

Updated by Junxiao Shi over 5 years ago

As a webdev, I won't use unversioned library, because there has been backwards-incompatible changes in NDN-JS history, and I can expect more in the future.

jsdelivr is a real CDN that can host any open-source library, but it will host only releases, and can't be used to host every git version.

#10

Updated by Jeff Thompson over 4 years ago

  • Assignee deleted (Alexander Horn)
#11

Updated by Junxiao Shi over 4 years ago

RawGit has a nice CDN that can be used to serve any NDN-JS version loaded from GitHub.

#12

Updated by Jeff Thompson over 4 years ago

Very nice. I put the following URL in an NDN-JS HTML page and it worked. https://cdn.rawgit.com/named-data/ndn-js/v0.10.0/build/ndn.min.js

Do you think we should advertise this in the README file?

#13

Updated by Junxiao Shi over 4 years ago

Yes, but the link should contain a release tag or commit hash.

Google Code Prettify references RawGit with 'master' branch, which is a bad idea because CDN can cache the file indefinitely.

#14

Updated by Jeff Thompson over 4 years ago

I added a RawGit URL example to the README. See the following diff. So, can we close this issue?
https://github.com/named-data/ndn-js/commit/f61d5f8895942e06a747a383fa341e7fc13bcd7e#diff-04c6e90faac2675aa89e2176d2eec7d8

#15

Updated by Junxiao Shi over 4 years ago

I agree with note-14.

#16

Updated by Jeff Thompson over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF