normaly you take damage when touching cactus about every 1/10-2/10 of a second, while after eating a (gold block)golden apple you take damage every .5/10-1/10 of a second. i have tested it and it is the regeneration 4 effect that causes it. not resistance or fire resistance.
1.Place 3 high cactus.
2.run into cactus
3.run into cactus after eating (gold block)golden apple while regeneration 4 effect is active.