Prostaglandins work at the spot that makes them rather than travelling. Inflammation switches on an enzyme that makes more of them, and they bring swelling and pain.
The references stop short of saying that ibuprofen works most where prostaglandins are being made. Four explanations are offered for that step: the drug, though everywhere, mattering where the making is; the drug building up or lingering in inflamed tissue; an added action in the spinal cord; and a nerve channel it blocks more strongly in acid. None of the sources ranks them or says how much each adds to the relief. In people, a review says, the first phase of an inflammation seems to run on the always-on enzyme, COX-1, with COX-2 rising within several hours.