Heteropolyacids (HPAs) are metal oxygen clusters that are nowadays widely used in acid catalysis. Indeed, as they possess a very strong Bronsted acidity, approaching the superacid region, they generally allow performing reactions at lower temperatures than conventional catalysts. In the present paper, we use in situ/operando Raman spectroscopy to optimize the catalytic performance of H3PW12O40-the strongest Keggin-type HPA in the low temperature (150 degrees C) gas phase dehydration of methanol to dimethyl ether (DME), which is one of the most promising renewable fuels for the future. Precisely, we demonstrate that the ability of methanol to displace the HPA's crystallization water located in-between the Keggin units and thus to reach the acidic protons decreases with increasing temperature. Actually, we show that one and the same flow of methanol scarcely displaces the crystallization water at reaction temperature 150 degrees C, whereas, at a temperature as low as 25 degrees C, it succeeds to completely dehydrate the HPA. By exploiting this, namely by pre-exposing the initially hydrated HPA to methanol at 25 degrees C right before heating it to a reaction temperature of 150 degrees C, the conversion increases dramatically, precisely by a factor 3. As reflected by the spectra, the flow of methanol at 25 degrees C does not only dehydrate but also recrystallizes the HPA (so rendering its structure more rigid and the diffusion in-between the Keggin units later at 150 degrees C more difficult). As a consequence, the conversion obtained at 150 degrees C is not as high as after a thermal dehydration under inert atmosphere. However, to be complete, the latter requires a temperature as high as 320 degrees C which is not tolerated by all HPA-based catalysts. In other words, the present work shows how to pretreat an HPA-based catalyst in order to maximize its catalytic performance in the methanol-to-DME reaction, depending on its resistance or not to a harsh thermal pretreatment.