Table of Contents Previous Section
Limit Page Sizes
Be aware of the size of the HTML pages that you are downloading to the client machine. The larger the page, the more time it takes to download and draw. At first glance, your component's HTML might not seem unreasonably large; however, be sure you take into account the following:
- HTML comments. HTML comments consume unnecessary download time. The WOIncludeCommentsInResponses user default forces WebObjects to strip all HTML comments from all generated components, reducing page sizes. Note that when using recording and playback, care must be take to both record and playback with the same value for this user default. Otherwise, differences will be found and playback will fail on correct pages.
- Image files. Does the page download a lot of images? If so, how large are these images? If image files are making the page too large, consider using GIF images, which are often much smaller than other formats, or consider limiting the number of images you use.
- Reusable components. Does the page include reusable components? If so, does the reusable component itself contain any reusable components? You must factor in the size of each component included and all of the image files that each component uses.
- Repetitions. If the page uses a repetition, how large it the array that the repetition iterates over? How large is the amount of HTML generated for each element in the array? In particular, if you have a repetition that generates a table row for each element in a large array, the page may take a long time to render.
Consider implementing a batching display mechanism to display the information in the table. For example, if the array contains hundreds of entries, you might choose to only display the first 10 and provide a button that allows the user to see the next 10 entries. If the repetition is populated by a WODisplayGroup, you can use WODisplayGroup's setNumberOfObjectsPerBatch: method to set up this batching, and it then controls the display for you. For more information, see the WODisplayGroup class specification in the online book WebObjects Framework Reference.
Table of Contents Next Section