-
☆ A M B ☆
- 2,213 Posts
Quote from: dinocorn at Nov 11, 2013, 06:08 PMDo you imagine you would disable compress_css and compress_js when using with a CDN? Seems like you'd need to ass with them on, the URLs would always be different.
If you are serving a library locally then the compress_css/js settings would apply normally, however if you are serving those resources from a CDN they would bypass compress_css/js (otherwise there wouldn't be a benefit).
If you look at FontAwesome 4.x served from CDNJS (//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.1/css/font-awesome.min.css) for example it's being served minified and gziped from the CloudFlare network (23 anycast datacenters globally).
Depending on where your website is hosted there could be drastic performance benefits using the CDN vs Local.
-
☆ A M B ☆
- 2,213 Posts
Quote from: dinocorn at Nov 11, 2013, 06:15 PMSpeaking of Manager asset management, I think there are a few things that are needed. None of which are officially on the current roadmap
- Dependency Management
- Cachebusting Add-on Assets
Dependency Management would prevent two versions of something like jQuery from being loaded by two separate Add-ons.
Currently cachebusting Add-ons has to be done manually. For example with Redactor, we rename the asset files to include the version number for each release. This is tedious, and we've forgotten to do it several times. It would be nice if the version of the Add-on was appended as a URL parameter, but of course that doesn't work with compression turned on because URL params get stripped out.
I've seen sites loading jQuery upwards of 6 times and jQuery UI upwards of 3 times all from different sources! It would be awesome to have some dependency management! I generally install ClientConfig and create a system group with links for commonly used resources (bootstrap resources, fontawesome, jquery, etc) allowing for easy upgrades down the road. Extending this functionality to the manager in some form would be awesome!
-
☆ A M B ☆
- 24,524 Posts
I dunno... I'm not overly fond of external sources for my assets. I have had too many sites that I commonly visit hanging from time to time because one of the external assets' servers are down. Although I suppose something like this would do the job of providing a fallback
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="assets/js/libs/jquery-1.7.1.min.js"><\/script>')</script>
-
☆ A M B ☆
- 24,524 Posts
I thought it did already, at least to some extent? All of the "reg" items are in an array, I thought the array was checked for duplicate values or something?
-
☆ A M B ☆
- 24,524 Posts
Ah, I see. That is a bit more complicated.
Wordpress handles it very well. You pass the name of dependency, version, and a path. It only includes it if appropriate.
jpdevries