Viewports are preferred, when the target in the chamber can be reached directly in a straight line or with the help of a small number of mirrors. Typical viewport materials have a low absorption in the desired wavelength range and feature minimal losses for a given thickness.
Additionally anti-reflection coatings, optimized for the wavelength or wavelength range of interest are used to minimize surface reflections. High absorbing materials can be used to block radiation e.g. lead-glass is a good X-Ray shielding material. The choice of materials and components of the flange-to-viewport assembly can be optimized to fulfill special requirements on magnetic permeability or conductivity.