First, what Safari does and doesn't cache is determined in more or less the same way as any other browser. When you load any element on a web page--the page itself (dynamically generated or otherwise), the stylesheet, an image, etc--it comes with an expiration date. Just about any modern browser will use that to determine when to next ask for the item is. Even then, the browser will usually just ask whether the element has changed since the last time it was retrieved, and if the answer is no (status 304), it doesn't bother downloading it again. That MacRumors logo at the top of the page, for example, was last modified on May 2nd, and has an expiration date one month from whenever it was downloaded. So your browser won't even check until mid-July, at which point if it hasn't changed, it still won't download it.
Coming back to the original question, you basically want Safari to save as much stuff as possible so you get as many 304 (not modified) results as possible.
And the method is, more or less, not to do anything--Safari will generally cache most stuff to disk until the expiry date when left to its own devices.
Leaving Safari open also helps--you can tell by its huge RAM usage that it's quite greedy about keeping stuff in memory to make navigation go as fast as possible.
One thing you definitely don't want to do is use Chrome; in an effort to make page loads faster it does all kinds of prefetch, up to and including (in the latest version) pre-loading the top Google hit as soon as you do a search. You can probably turn that off, but if you want to be stingy with bandwidth I'd wager it's better not to even run the risk.
Final note: If you're ONLY web browsing, I seriously doubt 5GB is going to be an issue--even with modern web pages, that's a lot of HTML and pictures. If, however, you want to spend some of those GB on watching video or downloading large files, that's an entirely different matter.