The disclosure provides a method for preparing a shelf-stable starch based food product, such as a rice or pasta product. The method includes introducing a quantity of a starch based ingredient and other ingredients including water in a container. The method further includes sealing the container with a volume of one or more gases present therein such that the volume of one or more gases is based on the quantity of the ingredients. The method also includes processing the container at a first temperature in the range 82 100oC and a first pressure, for substantially cooking the ingredients and further processing the container at a second temperature in the range 110 - 127oC and a second pressure for substantially sterilizing the contents, including the ingredients and gases inside the container. The headspace in the container allows the particles to swell on cooking without sticking to each other and forming lumps.