You gotta spend money to make money. That's why Limelight Networks (Nasdaq: LLNW) took a hit to its gross margins this quarter; the network-efficiency expert has been busy sewing up a stable operational future at the expense of some short-term pain.

That's why gross margins dipped a bit in the second quarter, only to come back stronger in the just-reported third. Limelight has signed long-term peering agreements with the major American networks to make video-grade bandwidth more affordable in the long run.

You may recall rival Level 3 Communications (Nasdaq: LVLT) making noise about peering contracts in a very public spat with local-traffic mastodon Comcast (Nasdaq: CMCSA). Comcast thought it unfair that Level 3 would get to shove tons of traffic onto the cable giant's customer networks without paying for the privilege; Level 3 accused Comcast of unfair business practices and refused to pay. It was ugly.

Limelight stayed quiet on the sidelines of that dispute while securing agreeable network terms with "the major U.S. access networks." That would include the big consumer-grade bandwidth wranglers Verizon (NYSE: VZ) and AT&T (NYSE: T), and perhaps also regional players such as Frontier Communications (NYSE: FTR) and CenturyLink (NYSE: CTL).

Yes, Comcast would most certainly be on that list. One catfight, avoided.

Going forward with fresh peering contracts in hand, I'd expect those gross margins to expand considerably over the next couple of years. At the moment, the metric stands at 35.5%, up from 31.7% in the second quarter. Limewire also reported a rare profit from continuing operations on 6% stronger sales, year over year.

Management expects margins to rise as revenues scale up, which makes the peering contracts sound like a bushel of fixed costs. So keep one eye on the top line while the other scans for fatter margins if you want to track how this investment is paying off. Our watchlist feature will help you perform that cross-eyed feat -- get started now!

And to learn more about last-mile networking, you can grab a free report that details one mouthwatering play on the growing bandwidth crunch on the consumer end of things. Spoiler alert: You'll hear more about the cable guys in this report, but we won't tell you to invest in Comcast. Get your copy now.

Fool contributor Anders Bylund holds no position in any of the companies mentioned. We Fools don't all hold the same opinion, but we all believe that considering a diverse range of insights makes us better investors. Check out Anders' holdings and bio, or follow him on Twitter and Google+. We have a disclosure policy.