It's unfortunate that you got caught, and very strange that you got hauled down the nick instead of just having your stash confiscated. You didn't make with the verbal towards the copper did you? In that kind of situation it's best to keep quiet and not make it worth his time.
Also in future if they try to caution you, refuse it. Then they have a choice of prosecuting you (which would never happen) and giving you a formal warning, which is less than a caution and doesn't stay on your record.