We released a web shop (http://www.hamperking.com.au (http://www.hamperking.com.au)) using SAP CRM 2007 late last year and recently implemented a number of improvements to the site. One area of focus was performance – how can we improve this without adding more hardware?
The first step was to analyse responses from the server (I used httpwatch (http://www.httpwatch.com/)) and identify the time consuming requests. From this, I noticed a large number of CSS and JS files requested.
We had a number of custom developed and standard SAP CSS and JS files. For each to be retrieved, a time costly request is sent and the file is downloaded. It is possible to improve this process by:
1. Minification – this removes unnecessary characters (such as line breaks and spaces) from a file to reduce its file size.
2. Combination – merging multiple files into 1 reduces the number of HTTP requests made
3. Compression – This further reduces the size of the file and the data required to be download
for combination and Winzip (http://www.winzip.com/index.htm) for compression. However this is a maintenance nightmare as it needs to be repeated whenever changes are made.
A preferred option is to leave the files as they are and dynamically minimise via java code. It is possible to write your own, but why do that when someone else has done all the hard work already?
To implement I followed the
2. Copy packtag/files/packtag-x.y.jar into your web-applications WEB-INF/lib directory from the packtag/files/web.xml into your /WEB-INF/web.xml
4. Restart Web AS
To use the Pack:Tag taglib in a JSP:
1. Declare it first:
<%@ taglib uri=”http://packtag.sf.net” prefix=”pack” %>
3. Accordingly for Cascading Style Sheets:
4. You can combine resources simply by listing them up:
If the files do not behave appropriately after minimisation, try different methods of compression. It is possible to change
So… the results
0.1. After minimisation
!https://weblogs.sdn.sap.com/weblogs/images/35446/tn_HWresultspost.jpg|height=91|alt=HTTP Watch results after minimisation|width=700|src=https://weblogs.sdn.sap.com/weblogs/images/35446/tn_HWresultspost.jpg|border=0!</body>