Doctors often advise wearing compression shorts or tight-fitting boxer briefs to patients after inguinal hernia surgery. They provide support to the groin region and help to reduce swelling.