I usually do it in the bottle with cap and I keep it on (just not tighten it firmly). As long as it is not properly dissolved.
I’m usually working with 1% agarose, but I think I have prepared also 4% in this way.
I cooked it on a hot plate on low temp with a stirring magnet and in the end put it in a microwave oven on low-medium for a couple of soconds a few times to get rid of the bubbles. and after getting a clear solution i added the atidium bromide.