Is there any other way to improve Azure CDN latency? - azure

I'm trying to improve the latency of CDN. The particular website will be accessed all over the world. Earlier the website wasn't provided using CDN but because of the slowness, used CDN but still getting the JS file from the CDN is very slow for two people on the same part of the world. I am not talking about accessing on the first time. It is happening randomly very often.

If it happens randomly very often, it sounds like there's something wrong with your caching settings.
To confirm that a file is actually coming from CDN, investigate the network traffic in your browser. If the file came from CDN it will have a "X-Cache: HIT" response header.
If you can't reproduce it yourself, click a "Manage" button in your CDN profile. It will open a management window for your CDN and there you can see total "hits" and "misses" for your files, if there's a lot of misses, that will indicate you are having a lot of files not going through CDN and should investigate your caching settings.
Also you should see if your files come out from CDN compressed. Based on your CDN and server settings, it's possible that uncompressed files are cached in the CDN.
If everything looks ok, a way to speed up Azure CDN is to use Dynamic Site Acceleration in addition to caching. It helps with potentially faster SSL negotiation and other network improvements.
https://learn.microsoft.com/en-us/azure/cdn/cdn-dynamic-site-acceleration

Related

CDN vs FTP.. which is better

I've been developing a site through microsoft azure. Been doing some styling with bootstrap and wanted to know if pulling the bootstrap library through CDN is faster or pulling it from my directory is faster after DEPLOYING? what will u suggest performance wise
CDN itself caches the files for specific timeperiod which makes it deliver the content faster. This adds an advantage when user first time visits your site. Also CDN have its geographical advantages. Also since the cache is shared between the users there will be minimal load on original server.I hope this would help you.

Varnish - WebTrends statistics

We currently get web analytics for a WordPress site using WebTrends.
If we use a caching mechanism like Varnish, I would assume WebTrends would suddenly report a dramatic reduction in traffic.
Is this correct and, if so, can you avoid this problem and get the correct statistics reported by WebTrends?
In my experience, acceleration caches shouldn't interfere with your Analytics data capture, because the cached content should include all of the on-page data points (such as meta tags) as well as the WT base tag file, which the user's browser will then execute and which will then make the call to the WT data collection server.
By way of a disclaimer, I should add that I haven't got any specific experience with Varnish, but a cache that acts as a barrier to on-page JavaScript executing is basically broken, and I've personally never had a problem with one preventing analytics software from running.
The only conceivable problem I could foresee is if a cache was going to the extent of scanning pages for linked resources (such as the "no javascript" image in the noscript tag), acquiring those resources in advance, and then reconfiguring the page being served to pull those resources from the cache rather than the third party servers. In which case you might end up with spurious "no javascript" records in your data.
Just make sure that your varnish config is not removing any webtrends cookies and it should be percetly OK. By default it does not but if you use some ready-made wordpress vcl then it might be you will need to exclude these cookies together with the wordpress-specific ones in the configuration.

I need to speed up my site and reduce the number of files calls

My webhost is aking me to speed up my site and reduce the number of files calls.
Ok let me explain a little, my website is use in 95% as a bridge between my database (in the same hosting) and my Android applications (I have around 30 that need information from my db), the information only goes one way (as now) the app calls a json string like this the one in the site:
http://www.guiasitio.com/mantenimiento/applinks/prlinks.php
and this webpage to show in a web view as welcome message:
http://www.guiasitio.com/movilapp/test.php
this page has some images and jquery so I think this are the ones having a lot of memory usage, they have told me to use some code to create a cache of those files in the person browser to save memory (that is a little Chinese to me since I don't understand it) can some one give me an idea and send me to a tutorial on how to get this done?. Can the webview in a Android app keep caches of this files?
All your help his highly appreciated. Thanks
Using a CDN or content delivery network would be an easy solution if it worked well for you. Essentially you are off-loading the work or storing and serving static files (mainly images and CSS files) to another server. In addition to reducing the load on your your current server, it will speed up your site because files will be served from a location closest to each site visitor.
There are many good CDN choices. Amazon CloudFront is one popular option, though in my optinion the prize for the easiest service to setup is CloudFlare ... they offer a free plan, simply fill in the details, change the DNS settings on your domain to point to CloudFlare and you will be up and running.
With some fine-tuning, you can expect to reduce the requests on your server by up to 80%
I use both Amazon and CloudFlare, with good results. I have found that the main thing to be cautious of is to carefully check all the scripts on your site and make sure they are working as expected. CloudFlare has a simple setting where you can specify the cache settings as well, so there's another detail on your list covered.
Good luck!

Understanding Azure Caching Service

By caching we basically mean, replicating data for faster access. For example -
Store freqeuently used data, from DB into memory.
Store static conents of Web page in the client browser.
Cloud hosting already uses closest DataCenter (CDN) to serve contents to the user. My question is, how does Caching Service makes it faster.
CDN is used to improve the delivery performance between your service datacenter and your customer, by introducing a transparent proxy datacenter that is nearer your customer. The CDN typically is set up to cache - such that requests from different customers can be serviced by the same "CDN answer" without calling the origin service datacenter. This configuration is predominantly used to offload requests for shared assets such as jpegs, javascript etc.
Azure Caching Service is employed behind your service, within your service datacenter. Unlike the built in ASP.NET cache, Azure Cache runs as a seperate service, and can be shared between servers/services. Generally your service would use this to store cross-session or expensive-to-create information - e.g. query results from a database. You're trading:
value of memory to cache the item (time/money)
cost (time/money) of creation of the item
number of times you'd expect to reuse the item.
"freshness" of information
For example you might use the memory cache to reduce the number of times that you query Azure Table, because you expect to reuse the same information multiple times, the latency to perform the query is high, and you can live with information potentially being "stale". Doing so would, save you money, and improve the overall performance of your system.
You'd typically "layer" the out-of-process Azure Cache with on-machine/in-process cache, such that for frequent queries you pull information as follows:
best - look first in local/on-box cache
better - look in off-box Azure Service Cache, then load local cache with result
good - make a call/query to expensive resource, load Azure Cache and local cache with result
Before saying anything I wanted to point you to this (very similar discussion):
Is it better to use Cache or CDN?
Having said that, this is how CDN and Caching can improve your website's performance.
CDN: This service helps you stay "closed" to your end user. Wit CDN, your websites content will be spread over a system of servers, each in its own location. Every server will hold a redundant copy of your site. When accessed by visitor, the CDN system will identify his/hers location and serve the content from the closest server (also called POP or Proxy).
For example: When visited from Australia your be server by Australian server. When visited from US you'll be server by US server and etc...
CDN will me most useful is your website operated outside of its immediate locale.
(i.e. CDN will not help you is your website promotes a local locksmith service that only has visitors from your city. As long as your original servers are sitting near by...)
Also, the overall coverage is unimportant.
You just need to make sure that the network covers all locations relevant to you day-2-day operations.
Cache: Provides faster access to your static or/and commonly used content objects. For example, if you have an image on your home page, and that image is downloaded again and again (and again) by all visitor, you should Cache it, so that returning visitor will already have it stored in his/hers PC (in browser Cache). This will save time, because local ressourses will load fasted and also save you bandwidth - because the image will load from visitor's computer and not from your server.
CDN and Caching are often combined, because this setup allows your to store Cache on the CDN network.
Also, this dual setup can also help improve Caching efficiency - For example it can help with dynamic Caching by introducing smart algorithms into the "top" CDN layer.
Here is more information about Dynamic Caching (also good introduction to HTTP Caching directives)
As you might already know, from reading the above mention post, no one method is better and they are at their best, when combined.
Hope this answers it
GL

My Windows Azure MVC3 application is slow. How can I see what's wrong?

I have deployed my Windows Azure application to the cloud. Now that it's running it seems to be slow. Some pages taking up to three seconds to return and all the look ups are to table storage with direct key lookups.
It's not very significant but when I check with fiddler I see all of my web requests are resulting in Status codes 200. Even those for the CSS. Is this expected. I thought the CSS would be cached.
Getting back to the original question. When performance is slow is there a way I can work out why? I already set the solution configuration to "Release". What more is there that I can do?
Any tips / help would be much appreciated.
For investigating the problems in production, you could try using StackOverflow's profiler to work out where the slowness is occurring - http://code.google.com/p/mvc-mini-profiler/
For looking at how to encourage browsers to use cached content for css, js and images, I think you can just use web.config files in subfolders - see IIS7 Cache-Control - and you should also be able to setup gzip compression.
You can try http://getglimpse.com
Seems promising
Put your files in the Azure storage and provide cache instructions:
Add Cache-Control and Expires headers to Azure Storage Blobs
If you want to do it from IIS, provide the proper HTTP caching instructions to the browser.
Best practices for speeding up your website.
Anyway, you have to provide more details about what are you doing. Are you using Session? how many queries launch each page?
The fact that in your computer, with just one client (you) goes fast, doesn't mean the application is fast, you have to try with lots of users in order to ensure there is no bottlenecks, contention locks, busy resources etc.. etc..

Resources