Canonicalize Géoportail API V2.12 using jsDelivr Github CDN and mod_pagespeed, or, included as a simple direct url.
Using Apache mod_pagespeed - In pagespeed.conf:
This will enable canonicalization for GeoportalExtended.js (API geoportail V2.1.2) using jsDelivr Github CDN - The parameter below will enable detection from this librarie size and checksum :
ModPagespeedEnableFilters canonicalize_javascript_libraries
Adding this :
ModPagespeedLibrary 2501255 4rkPXu2ba2rm4IzplzhHP \
//cdn.jsdelivr.net/gh/opalesurfcasting/[email protected]/GeoportalExtended.min.js
will enable canonicalization for GeoportalExtended.js, also based on file size 2501255 and checksum. This is needed as this file is not in default canonicalized libraries list.
Find the size and checksum :
pagespeed_js_minify --print_size_and_hash GeoportalExtended.js
- Find the size and checksum
minified : https://cdn.jsdelivr.net/gh/opalesurfcasting/[email protected]/GeoportalExtended.min.js
fix target='_blank'
without rel='noopener'
in GeoportalExtended.js https://mathiasbynens.github.io/rel-noopener/
fix CGU url
use rel="preload" as="style" for css in GeoportalExtended.js https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content https://developers.google.com/web/tools/lighthouse/audits/preload
When canonicalized, libraries will not be combined or minifyed by mod_pagespeed, but it can be done through jsdlivr. It's up to you to check what is the best.
IGN (Géoportail) Sources repository : https://depot.ign.fr/geoportail/api/develop/tech-docs-js/fr/developpeur/download.html
https://github.com/opalesurfcasting/api-geoportail-v2/blob/master/LICENSE