Are you sure there is a vacuum?
It is more likely pressure build up within the tank. The filler cap usually has a valve built in that will guard against over pressure.
The fuel filler cap should generally be released slowly to allow the pressure to ease out. It may well be that you are opening the filler cap quickly and the pressure is released in a 'gush'.
The problem with opening the cap quickly is that if there is sufficient fuel in the tank, you risk a blast of fuel vapour whether it be petrol or diesel.
If you have a vacuum, I think you may have other issues, but since I have not experienced a vacuum problem with any fuel tank I have ever worked on, I could be way off the mark.