An optical sensor system comprising: an optical sensor (102,300) that comprises a sensor head (112, 304) that includes an optical window (312,314), at least one light source configured to emit light through the optical window into a liquid flow of fluid, and at least one detector configured to detect fluorescent emissions through the optical window from the flow of fluid; and a flow chamber (110,302) that includes a housing defining a cavity into which the sensor head is inserted, an inlet port configured to communicate the flow of fluid from outside of the cavity to an interior of the cavity, and an outlet port configured to communicate the flow of fluid from the interior of the cavity to back outside of the cavity, the inlet port defining a fluid nozzle configured to direct the flow of fluid against the optical window (312,314); a liquid source configured to supply the liquid flow of fluid communicating through the inlet port; characterized by: a gas source configured to supply a gaseous flow of fluid communicating through the inlet port; and a controller configured to control the gas source so as to place the gas source in fluid communication with the flow chamber (110,302) so as to evacuate the flow chamber (110,302) of liquid, and control the liquid source so as to place the liquid source in fluid communication with the flow chamber (110,302) so as to direct liquid through the fluid nozzle, through a space of the flow chamber evacuated of liquid, and against the optical window (312,314). an optical sensor (102,300) that comprises a sensor head (112, 304) that includes an optical window (312,314), at least one light source configured to emit light through the optical window into a liquid flow of fluid, and at least one detector configured to detect fluorescent emissions through the optical window from the flow of fluid; and a flow chamber (110,302) that includes a housing defining a cavity into which the sensor head is inserted, an inlet port configured to communicate the flow of fluid from outside of the cavity to an interior of the cavity, and an outlet port configured to communicate the flow of fluid from the interior of the cavity to back outside of the cavity, the inlet port defining a fluid nozzle configured to direct the flow of fluid against the optical window (312,314); a liquid source configured to supply the liquid flow of fluid communicating through the inlet port; characterized by: a gas source configured to supply a gaseous flow of fluid communicating through the inlet port; and a controller configured to control the gas source so as to place the gas source in fluid communication with the flow chamber (110,302) so as to evacuate the flow chamber (110,302) of liquid, and control the liquid source so as to place the liquid source in fluid communication with the flow chamber (110,302) so as to direct liquid through the fluid nozzle, through a space of the flow chamber evacuated of liquid, and against the optical window (312,314). a gas source configured to supply a gaseous flow of fluid communicating through the inlet port; and a controller configured to control the gas source so as to place the gas source in fluid communication with the flow chamber (110,302) so as to evacuate the flow chamber (110,302) of liquid, and control the liquid source so as to place the liquid source in fluid communication with the flow chamber (110,302) so as to direct liquid through the fluid nozzle, through a space of the flow chamber evacuated of liquid, and against the optical window (312,314).