Buy more RAM.
Preview at a lower resolution.
Read this page, it has lots of useful info including this bit:
The number of frames that can be stored for real-time playback depends on the amount of RAM available to the application and the settings in the Preview panel.
Yeah, for CS5 this is really easy. After Effects CS5 will use for RAM previews all of the RAM that you have allocated to it. After Effects CS4 was much more limited because it was a 32-bit application.
does anyone know how to get longer RAM previews in After Effects CS5?
As in any version before: Buy more RAM! Regardless of CS5 being 64bit, you will of course not see longer previews if the system is not outfitted accordingly. E.g. if you just updated your operating system from 32bit to 64bit, but otherwise did not change the hardware, 4GB RAM will still only allow you so and so much. Of course the old tips of reducing preview res and so on still apply, also.