That would still have a 30 minute ping. You should just have a Martian Internet and then sync up the two every few hours or something.
the "internet" is just a network of computers. "sync up the two" would involve replicating the servers and coming up with some sort of consensus protocol. Needless to say, that's non-trivial to implement and needs to be done for each site individually. If there was a martian colony it might be economically feasible for some sites to do this, but if it's just a few astronauts the most feasible way of implementing internet browsing would be something like archive.today, where you send a url to some server on earth, the server runs a headless browser and takes a screenshot, and sends the captured contents back to mars/spacecraft.