Cheese is more compact and has a longer shelf life than milk, although how long a cheese will keep depends on the type of cheese.