Loading blog entries.. loading


Blogs which referenced tag: [HTTP]

 

Cache Reverse Proxy - nginx

 
Written by Wayne Ye  Thursday, January 10, 2013

Introduction

On the homepage of nxing wiki, there used to be one sentence which really impressed my very much when I first time to take a look at it and learn it three years ago:

Apache is like Microsoft Word, it has a million options but you only need six. Nginx does those six things, and it does five of them 50 times faster than Apache.  --Chris Lea


View Post»



Permalink:http://wayneye.com/Blog/Cache-Reverse-Proxy-nginx
Tag:

Observation on CDN

 
Written by Wayne Ye  Sunday, October 7, 2012

Motivation

Leveraging CDN (Content Delivery Network) to speed up static files loading time is one of the most important fact which affects a website's loading time, CDN was emphasized in many articles related with improving website's performance, for example:


View Post»



Permalink:http://wayneye.com/Blog/Observation-On-CDN
Tag:

HTML5 WebSocket in Essence技术分享

 
Written by Wayne Ye  Saturday, August 20, 2011

今天下午,我非常荣幸受邀参加HTML5兴趣小组每月一次的沙龙活动,我给大家分享了HTML5 WebSocket的特性,协议本质,以及我的Team Poker demo。

第一次做技术分享,表面“淡定“,内心紧张,因语速较快原本打算持续1个小时左右的分享,大约40分钟就结束了,囧Smile

现场照片

现场照片

在谈各种comet技巧

Wayne

PPT

HTML5 WebSocket in Essence on Prezi

现场视频

摄影帅哥貌似对焦不实的说Smile

下一次,希望更好!+U!


View Post»



Permalink:http://wayneye.com/Blog/HTML5-WebSocket-In-Essence-Public-Speak
Tag:

AJAX Cross-Origin HTTP request

 
Written by Wayne Ye  Friday, April 1, 2011

Background

Cross-Origin Request Sharing - CORS (A.K.A. Cross-Domain AJAX request) is an issue that most web developers might encounter, according to Same-Origin-Policy, browsers restrict client JavaScript in a security sandbox, usually JS cannot directly communicate with a remote server from a different domain. In the past developers created many tricky ways to achieve Cross-Domain resource request, most commonly using ways are:

  1. Use Flash/Silverlight or server side as a "proxy" to communicate with remote.
  2. JSON With Padding (JSONP).
  3. Embeds remote server in an iframe and communicate through fragment or window.name, refer here.

And so on..

Those tricky ways have more or less some issues, for example JSONP might result in security hole if developers simply "eval" it, and #3 above, although it works, both domains should build strict contract between each other, it neither flexible nor elegant IMHO:)

W3C had introduced Cross-Origin Resource Sharing (CORS) as a standard solution to provide a safe, flexible and a recommended standard way to solve this issue. 

Mechanism

From a high level we can simply deem CORS is a contract between client AJAX call from domain A and a page hosted on domain B, a tipical Cross-Origin request/response would be:

DomainA AJAX request headers

Host DomainB.com
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,application/json
Accept-Language en-us;
Accept-Encoding gzip, deflate
Keep-Alive 115
Origin http://DomainA.com 

DomainB response headers

Cache-Control private
Content-Type application/json; charset=utf-8
Access-Control-Allow-Origin DomainA.com
Content-Length 87
Proxy-Connection Keep-Alive
Connection Keep-Alive

The blue parts I marked above were the kernal facts, "Origin" request header "indicates where the cross-origin request or preflight request originates from", the "Access-Control-Allow-Origin" response header indicates this page allows remote request from DomainA (if the value is * indicate allows remote requests from any domain).


View Post»



Permalink:http://wayneye.com/Blog/Ajax-Cross-Origin-HTTP-request
Tag: