Researchers in multiple studies are finding that drinking coffee just before a short nap is better for your alertness than napping or coffee-drinking alone. The idea is that caffeine takes about 20 minutes to digest, so if you drink a cup quickly then snooze off for about 20 minutes, you will use up the sleepiness in your brain before you receive the perkiness you just consumed. For a more scientific explanation, see the article.