In reference to this comment:
"However, in my personal experience I have a feeling of alertness already when I drink my cup of coffee: This is most likely just a placebo effect, but I don't care as long as it works."
The effects of coffee may peak after 30 to 60 minutes. However, (brewed/orally consumed) coffee is a complex, compound stimulus comprised of a distinctive (and delicious!) smell, taste, temperature and usually presented in particular cups (porcelain, heavy glass) and contexts (times, coffee shops).
These conditions are not "the placebo effect" in which an inert substance is said to exert some effect despite the lack of an active ingredient (usually a term used in group studies btw to account for non-significant variability).
Caffeine is a very powerful active ingredient.
What is occurring here is delay conditioning, first documented by Ivan Pavlov (aka "Pavlovian conditioning").
The "delay" pairing of a neutral stimulus (the most salient or powerful being the smell and taste) of coffee with an unconditioned stimulus (caffeine) over several trials tends to cause weak conditioned responses to those stimuli (which are now said to be conditioned stimuli (CS), and the weaker responses are now conditioned responses (CR)).
The initial reflex would be a (caffeine)US-> (activation)UR relationship which becomes a CS-> CR.
So the apparent effectiveness of a cup of coffee "almost immediately" (within a few minutes) can be accounted for as a conditioned reaction to the delay conditioning of repeated coffee consumption by the conditioned stimuli of the smell and taste of coffee (and to a lesser extent the additional compound stimuli of place, cup, time of day which are described as V(sum) in the Rescorla-Wagner formula).