If you are linking to libraries, you might want to think again.
http://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/
If you are linking to libraries, you might want to think again.
http://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/ Geeks, making the world a better place |
Best practices would be to host libraries locally and setup a cron job to automatically download/update the libraries every few hours.
Helps your page speed dramatically and you wont have downtime / other loading issues with the hosted libraries.
Pretty easy: 1. make php file to download remote files 2. make cron job 3. update script to locally reference libraries
PHP File (analytics-cron.php) <?php
Cron job be like... (ubuntu 14.04) * */2 * * * /usr/bin/php /path-to-www/etc/cron/analytics-cron.php &> /dev/null |
The thing mentioned by OP has nothing to do with serving asset locally or from a cdn. Its just some npm related stuff which dolphin doesn't use so its not a big issue here I assume. so much to do.... |
Hi Arkane. This is really interesting information. One of the things which I never considered. When running various sites against Pagespeed, Yslow, etc one of the things which takes a long time to load is the google analytics js. Below you've just provided a way for us to host it locally, which really makes sense (to me) since that script isn't there for the client, but really for the server. Loading it locally will mean less DNS requests on the server side, resulting in quicker page loading times for the client. Hosting js scripts like this on CDN's also don't make sense, since the script needs to be loaded locally in this particular case. Would you recommend doing this with other scripts and if so, which ones?
Best practices would be to host libraries locally and setup a cron job to automatically download/update the libraries every few hours. Helps your page speed dramatically and you wont have downtime / other loading issues with the hosted libraries.
|
Hi Prashank. Chat+ (used by Dolphin for the new non-flash chat) uses npm, so it's possible that could have broken.
The thing mentioned by OP has nothing to do with serving asset locally or from a cdn. Its just some npm related stuff which dolphin doesn't use so its not a big issue here I assume.
|
Hi Prashank. Chat+ (used by Dolphin for the new non-flash chat) uses npm, so it's possible that could have broken.
The thing mentioned by OP has nothing to do with serving asset locally or from a cdn. Its just some npm related stuff which dolphin doesn't use so its not a big issue here I assume.
Oh...yea i remember now. so much to do.... |
Would you recommend doing this with other scripts and if so, which ones?
really anything that pulls from an outside server... google, facebook, etc... in some cases (like copy paste html widgets) the asset references other assets as they were local files (like: /path/file.xyz) and not with a full domain (like: http:// somesite.com/path/file.xyz)... in these rare cases it will not work to have them local... (i only ran into one i used, just found something else to replace it.) anyhow... I'm going to do a write up with the files you need to make this work. bottom line... page speed is very important, page speed and best practices affects your ranking... google actually recommends you run it this way. if you view the source of popular websites you'll see google analytics js is locally referenced. |