Cephalexin can be given with or without food. If your pet vomits or acts sick after receiving the medication, try giving it with a small amount of food. This medication will take effect quickly, in about 1 to 2 hours, but visible effects may take a few days to be recognized.