November 14, 2008 – 10:29 pm by coachwei
HTTPS Tunneling, also called HTTPS Proxy, SSL proxy, or SSL tunneling, refers to sending HTTPS content via a proxy server. This is a very common usage scenario over the web.
Unfortunately, I have not found any Java server that supports this yet. Tomcat chokes up quickly if you tunnel HTTPS messages (tried both Tomcat 5.x and 6.x). Other Java servers don't even come close. Jetty is the furthest and closest to supporting it. Greg Wilkins even wrote two examples showing Jetty's proxy support (ProxyServlet and AsyncProxyServlet, though both of them only partially work when I tried to run them on on Jetty 6.x and Jetty 7.x).
The main problem for all these servers is that they do not support HTTP Connect. We all know HTTP GET, and HTTP POST, and all servers support these common HTTP methods beautifully, except for HTTP Connect.
The ... Continue Reading »
Posted in WebDev |
1 Comment
November 7, 2008 – 12:23 pm by coachwei
Jeremy Geelan is speculating who should be America's CTO in the Obama administration. He says:
As former IAC executive Julius Genachowski was appointed yesterday to President Elect Obama's transition team, speculation is growing as to the possibility that Genachowski or someone like him may one day soon become the country's first Chief Technology Officer. Barack Obama's transition team also includes Sonal Shah of Google.org and Donald Gips, VP of corporate strategy and development for Level 3 Communications.
Other candidates for the nation's CTO position being mooted in the press are: Google's CEO Eric Schmidt, Sun co-founder Bill Joy, etc.
First of all, the notion of having a CTO for USA is very exciting. It's a job that I'd really want to have - I'm working on my resume right now!!!
More importantly than who will be the CTO is which industry this person should be coming from. I'd really really recommend the following ... Continue Reading »
Posted in politics |
3 Comments
November 5, 2008 – 8:21 pm by coachwei
I am excited to announce the early beta release of Razor Optimizer, a JavaScript optimization tool for reducing code footprint and increasing runtime performnace. As a cross-browser web application itself, Razor Optimizer can be access either online as a service, or to be downloaded to run locally.
Razor Optimizer is based on a new approach for JavaScript optimization called "razor". While other optimization techniques such as JS minimization and concatenttion are based on static lexical analysis, Razor uses dynamic runtime profile information to achieve breakthrough results of 60% to 90% savings.
Why Razor Optimizer?
It is safe to say that Ajax is the technology foundation for Web 2.0. There are several hundred Ajax toolkits in the marketplace and new ones are still emerging.
While Ajax is getting real popular over the web, what people may not know is that Ajax(JavaScript) code is becoming the top 1 or 2 ... Continue Reading »
Posted in Main Page, WebDev |
No Comments
October 27, 2008 – 3:18 am by coachwei
The wild popularity of Ajax fueled widespread usage of JavaScript. Almost every web 2.0 application relies on JavaScript to deliver front end interactivity. A growing list of JavaScript libraries (over 200+) are being created by various Ajax developers, some of which have gathered significant community adoption.
Though the usage of JavaScript code can lead to significant better overall user experience, it can also bring problems if not used properly. Some of the common performance related problems are:
Sluggish network and runtime performance. It is common to see web pages that load several hundred kilobytes of JavaScript. The size of JavaScript libraries ranges from kilobytes to several hundred kilobytes, or even megabytes. Big footprint introduces not only longer download/parsing time, but also bigger client side memory/CPU footprint. For some browsers, parsing/processing large script can take an excessive amount of time (Firefox bug #313967);
The browser freezes from time to time. There are ... Continue Reading »
Posted in WebDev, web 2.0 |
No Comments
– 3:04 am by coachwei
Yahoo’s Performance team summarized their experience in web performance optimization into 14 rules in general (Reference 4, http://stevesouders.com/examples/rules.php):
1. Make Fewer HTTP Requests
2. Use a Content Delivery Network
3. Add an Expires Header
4. Gzip Components
5. Put Stylesheets at the Top
6. Put Scripts at the Bottom
7. Avoid CSS Expressions
8. Make JavaScript and CSS External
9. Reduce DNS Lookups
10. Minify JavaScript
11. Avoid Redirects
12. Remove Duplicate Scripts
13. Configure ETags
14. Make AJAX Cacheable Continue Reading »
Posted in WebDev, web 2.0 |
No Comments
– 2:49 am by coachwei
In order to understand how the front end, especially JavaScript, is impacting web performance today, some typical web pages were studied. The following table shows content composition of the front pages of two representative web sites, American Airline (www.aa.com) and FaceBook (www.facebook.com):
Table 1: Content Composition of Selected Web Sites
aa.com front page Size (%)
Facebook.com front page Size (%)
Total footprint:
810KB (100%)
687KB (100%)
JavaScript:
334KB (42%)
532KB (77%)
HTML
182KB (23%)
23KB (3%)
Images (.gif, .jpg, .png)
201KB (29%)
78KB (11%)
CSS files
69KB (9%)
45KB (7%)
Figure 2: Front Page of aa.com and facebook.com
In both cases, the initial HTML text is only a small percentage of the page footprint (23% and 3% respectively). This is generally true for web pages today. Secondly, the biggest portion of both pages is JavaScript, at 42% and 77% respectively. ... Continue Reading »
Posted in Main Page, WebDev |
No Comments
– 2:28 am by coachwei
Every web application requires satisfactory performance in order to be functional. Every web application has its own context that different factors influence performance differently. Since the beginning of the web, there have been many performance tuning endeavors responding to what the context calls for.
A good metric to gauge web performance is page loading time. Page loading time refers to the time from when browser issues the page URL request to the moment when the page is loaded, rendered and ready for user interaction. Page loading time is determined by three factors:
Server processing time: the amount of time that the server takes to process a page request and deliver the response to the client;
Network transfer time: The amount of time that it takes to transfer the content from one end point to the ... Continue Reading »
Posted in WebDev |
No Comments
September 30, 2008 – 9:28 pm by coachwei
A couple of years ago my friend Kaushal Vyas blogged about his first marathon experience. His blog entry started with some quotes from Lance Armstrong on his first marathon:
“the hardest physical thing I have ever done. Even the worst days in the tours, nothing was as hard as that and nothing left me feeling the way I feel now in terms of sheer fatigue and soreness. I think I bit off more than I could chew, I thought the marathon would be easier...”.
It didn't resonate with me at the time. In fact, I didn't feel anything besides saying "wah, cool". What I didn't know (I'm sure Kaushal didn't know either) is that he planted some seeds in me at the time that would only grow two years later.
In Boston where I live(Kaushal lives in LA), my friend Ying actually has been running marathon many times. I always admired her for ... Continue Reading »
Posted in marathon |
3 Comments
September 13, 2008 – 8:36 pm by coachwei
These are a few key concepts of JavaScript language that developers should know: execution context, activation object, variable instantiation, scoping, closure, eval and "this" keyword. Knowing these would help one tremendously in Ajax development.
For example, when you write an inner function, you know that you can access the local variables defined in the outer function as if they were defined locally. You can also access the global variables. -Why? How does the host environment resolve such variables?
Another example: When you pass arguments to a function, you can access these arguments as if they were locally defined variables. How does this work?
A slightly more involved example that developers must have seem similar code a lot but may not know the "why":
function outerFunc(outerArg){
var localVar = 100;
function innerFunc(innerArg){
localVar+=100;
return (outerArg +innerArg + localVar);
... Continue Reading »
Posted in WebDev |
No Comments
September 3, 2008 – 6:02 am by coachwei
"This is the best browser so far" is that I can say after being a Chrome user for one day.
First of all, I was glad to find out that I haven't found Chrome breaking any web application yet, especially Ajax applications. I was a little concerned about this, given that the Chrome cartoons say "Javascript runs in its own thread", which is different from the threading model today.
For example, Razor Profiler is a fairly Javascript-heavy web application that I wrote to perform JavaScript profiling and Ajax performance analysis. It includes tens of thousands of lines of JavaScript code on the client side, and employs a lot of "tricks" to make a web application deliver similar performance characteristics to native applications. -Razor Profiler works well on Chrome.
I also tried a few applications on Dojo, ExtJS and jQuery. All worked well without a glitch.
After the initial concern eliminated, now I was able to ... Continue Reading »
Posted in WebDev, google |
2 Comments
September 1, 2008 – 10:13 am by coachwei
This entry documents a few tips related to using Rhino JavaScript Engine to process JavaScript code. If you are using Rhino, you probably won't run into the issues covered in this post during development or even testing. However, you are fairly likely to run into these issues after your system goes live. It would easily result in days or even weeks of soul searching (speaking from my personal experience:-)). Part of the problem seems to be the lack of documentation from the web. The other part of the problem is that the problem is rather a Java language problem(very convoluted). - Java limits the maximum method size to be 64KB.
1. JVM Byte Code Size Limit Problem
On rare occasions, you will see exceptions like the followings from Rhino when processing JavaScript files:
Exception in thread "main" java.lang.IllegalArgumentException: out of range index
at org.mozilla.classfile.ClassFileWriter?.add(ClassFileWriter?.java:541) at org.mozilla.classfile.ClassFileWriter?.addLoadConstant(ClassFileWriter?.java:601) at org.mozilla.classfile.ClassFileWriter?.addPush(ClassFileWriter?.java:837) at org.mozilla.javascript.optimizer.BodyCodegen?.visitSpecialCall(Codegen.java:2571) at org.mozilla.javascript.optimizer.BodyCodegen?.generateExpression(Codegen.java:1763) at org.mozilla.javascript.optimizer.BodyCodegen?.visitSetProp(Codegen.java:3743) ... Continue Reading »
Posted in Tips, WebDev |
4 Comments
August 16, 2008 – 7:47 pm by coachwei
Razor Profiler
(beta), an online Ajax profiling tool, is available for public review now at http://www.razorspeed.com.
What Is it?
Razor Profiler(beta) is a web-based Ajax profiling tool to help web developers understand and analyze the runtime behavior of their JavaScript code in a cross-browser environment. Razor Profiler
can be access either online as a service; or be downloaded to run locally. Some Razor Profiler screen shots are shown below:
.imageListTable {
text-align: center;
margin-left: auto;
... Continue Reading »
Posted in WebDev |
No Comments
July 17, 2008 – 6:57 am by coachwei
What does the Ajax community want from future browsers? How are these different requests prioritized? Web developers have done amazing things with Ajax for both Web 1.0 and Web 2.0 applications, but what barriers need to be removed to enable the next generation of browser-based innovations? The future of Ajax runtime environments matters more than ever today.
In late 2007, OpenAjax Alliance formed Runtime Task Force (http://www.openajax.org/member/wiki/Runtime) to address this community concern. The goal is to collect, articulate, and prioritize key issues from the Ajax community, and communicate them to browser vendors. This will help educate the community in large, help browser vendors better plan for their product roadmap, and help developers better use Ajax.
There are other great rich Web UI technology initiatives such as W3C’s HTML5, CSS3 and SVG. The OpenAjax browser wish list is not intended to compete with these initiatives, but instead complements them by capturing and communicating ... Continue Reading »
Posted in WebDev |
3 Comments
June 23, 2008 – 9:14 am by coachwei
What would you like to see in the next generation of browsers? Can you help to make the web a slightly better place than where it is today?
Various people from the Ajax community have put together a good list of feature requests (a total of over 40), collected at OpenAjax Runtime Task Force . Now it is time for everyone to cast your vote!
Voting is easy. Just sign up at OpenAjax Wiki . Then go to
the voting page , select the priority number from a dropdown box for features that you care. -That's it. Your results will be calculated and displayed in immediately. Once you select a priority item from the dropdown box, your selection is immediately sent to the server and recorded int the database. A nice use case of the asynchronous feature of Ajax. Of course, you can always come back and make changes. (Thanks Jon ... Continue Reading »
Posted in WebDev |
1 Comment
June 19, 2008 – 5:17 pm by coachwei
If the visual editor (TinyMCE) in your newly installed Wordpress is not showing up, this maybe a solution to your problem.
First, Make Sure your visual editor is turned on. In the Wordpress admin, up in the upper right corner, click on your user name, and then make sure “Use the visual editor when writing” is checked.
Open a tab or window in a browser, and go to [your site]/wp-includes/js/tinymce/tiny_mce_config.php - if you don't get a screen full of garbage and errors here, this post is not for you. You have a different problem.
If you do see a lot of garbage from the above url, it most likely mean that there is a compression related problem with your tinyMCE javascript file. The actual compression is done on the server by a file [wp-includes/js/tinymce/tiny_mce_config.php]. This file will compress the tinymce.js files (over 200kB) using gzip and save the compression result to [wp-content/uploads/js_cache] ... Continue Reading »
Posted in Tips |
3 Comments
|
|
|
|