Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5610

Introduce IApplicationSettings.useCdnResources() that will serve jQuery from CDN and can be used by 3rd party libs

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Later
    • Affects Version/s: 6.15.0
    • Fix Version/s: None
    • Component/s: wicket
    • Labels:
      None

      Description

      wicket-bootstrap has a IBootstrapSettings.useCdnResources() which is a great idea.

      Wicket should adopt this setting in core. And when true, Wicket JS libraries such as jQuery should use public CDN.

      This setting will default to true on DEPLOYMENT, and false for DEVELOPMENT (but of course, can be set to true programmatically).

      wicket-bootstrap will then can use CDN settings from wicket core.

      In addition, I would suggest a variant of JavaScriptResourceReference that also has an additional parameter for cdnUrl (which can be String for convenience or Url for strictness, up to you), e.g. :

      	public HowlerJavaScriptReference() {
      		super(HowlerJavaScriptReference.class, "howler.js", "//cdnjs.cloudflare.com/ajax/libs/howler/1.1.17/howler.min.js");
      	}
      

      its behavior will switch based on useCdnResources setting, and very easy and practical to code this way.

        Attachments

        1. use-cdn-app.tgz
          25 kB
          Martin Grigorov

          Issue Links

            Activity

              People

              • Assignee:
                mgrigorov Martin Grigorov
                Reporter:
                ceefour Hendy Irawan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: