I think relying on the hill giant and ogres posted outside the cave to prevent the players from retreating to take a long rest is what got you in this pickle in the first place. Instead of trying to prevent the possibility of a long rest, I would recommend insuring that taking a long rest has consequences. Sure, the party can go back into the mine the next day, fight one group of monsters, and come right back out again to rest back up to full. But the mine shouldn’t just sit in suspended animation while they do that. The monsters in the mine should fortify their defenses in anticipation of the players’ next incursion. Meanwhile, the players are spending nearly 24 hours just sitting there at a camp in the middle of the wilderness just outside of a monster-infested mine. There should be several random encounter rolls during that time. The 5-minute workday is only really a problem if you allow it to be an effective strategy. Simply making it a risky proposition will, I think, be far more effective than plopping a kill box outside the dungeon. It makes taking or not taking rest into a tactical decision, instead of being the obvious best option that you’re only allowed to make every so often.