dimanche 19 avril 2015

Cloudfront Loading Slowly on Website

I have a cloudfront with static javascript and css files. Say i go on http://ift.tt/1yI1R0S. It takes less than 40 ms. However if I go to my website the same bootstrap-datepicker.js takes 850 ms. Why is this the case and how can i fix it? Here is the code i use for including the js file in my code. If I refresh the page and the bootstrap-datepicker.js gets cached it takes like 400 ms to load it which I still feel like is slow.

<script src="http://ift.tt/1yI1R0S" type="text/javascript"></script>

I use node js but supposedly that's fast. And I think it has no effect on this because I'm using a cdn. I'm using an amazon ec2 ubuntu instance. How do I debug something like this? I would like this script to load in under 100 ms. Without js files my node js page loads within 50 ms. At this point I don't know if I should switch back to php on apache or maybe nginx. I was really excited to use node js along with mongodb. I don't know if it's a good idea to run both apache/nginx and node js at the same time. I feel like it would be hard to work with sessions if I try to use both. The main reason I'm using node is because of webrtc and sockets.io. Any help would be appreciated.

Aucun commentaire:

Enregistrer un commentaire