Posts

Showing posts from March, 2011

Caching Dynamically Generated Scripts

If static JavaScript or CSS files are served from the application server, we take it for granted that they are going to be cached by the browsers. However, dynamically generated content (Javascript and CSS in particular) could also be cached as if it is static and sent from the server only when it is changed. Nevertheless, application servers provide no support for this at all. So, the responsibility rests on the shoulders of the server-side code which generates dynamic content.

I looked all over the Internet but was unable to find a solution, so I wrote my own code. It's written for a Java Servlet but the same logic can be applied to other languages too. The servlet below sends a piece of JavaScript to the client that it builds dynamically and adds the necessary headers to the response so that the browser can cache it.

Here's the code that gets the job done:

public class TestServlet extends HttpServlet { private static final String CONTENT_TYPE = "application/x-javasc…

True Cross Browser Web Applications

Having a truly cross browser web application is like being truly happy. The moment you get there, someone is going to bring you up to date and ruin everything. And like happiness, you will never attain it if you chase it. And like happiness, it is a byproduct of devoting yourself to something that you are passionate about.

Developers tend to believe that the moment they start using a JavaScript library that works across browsers, they are immune to the problem. Nothing can be further from the truth. If you use such a library, this only means that the code inside the library is compatible with many different browsers. It does not automatically follow that any new line of code you will write for your application is going to work the same way across browsers. This is a hugely misunderstood concept.

With your first line of Javascript or HTML you are in cross browser hell. Let me repeat this. With your first line of Javascript or HTML you are in cross browser hell. Virtually in every proj…

Aloha ICSSP 2011

We are thrilled to announce that our team member M. Serdar Biçer will present his paper “Defect Prediction Using Social Network Analysis on Issue Repositories” at the International Conference on Software and Systems Process, ICSSP 2011. His work is one of the 18 papers accepted to the conference world wide. We congratulate him for his amazing success. Serdar, enjoy your trip to Hawaii!