It is well known that the feedback mechanism or the individual's intuitive response to the epidemic can have a vital effect on the disease's spreading. In this paper, we investigate the bifurcation behavior and the optimal feedback mechanism for an SIS epidemic model on heterogeneous networks. Firstly, we present the bifurcation analysis when the basic reproduction number is equal to unity. The direction of bifurcation is also determined. Secondly, different from the constant coefficient in the existing literature, we incorporate a time-varying feedback mechanism coefficient. This is more reasonable since the initiative response of people is constantly changing during different process of disease prevalence. We analyze the optimal feedback mechanism for the SIS epidemic network model by applying the optimal control theory. The existence and uniqueness of the optimal control strategy are obtained. Finally, a numerical example is presented to verify the efficiency of the obtained results. How the topology of the network affects the optimal feedback mechanism is also discussed.