The purpose of this study was to improve the efficacy of olopatadine hydrochloride (OT) in treating allergic conjunctivitis (AC). To achieve this goal, we developed an eye formulation without antimicrobial agents using a temperature-pH dual-sensitive in situ gel technology combined with heat sterilization. Various types of carbomers were evaluated and their optimal doses determined. The prescription containing poloxamer 407 (P407) and poloxamer 188 (P188) was optimized using central composite design for response surface methodology (CCD-RSM). The final optimized dual-sensitive in situ gel (TP-gel) consisted of 0.1% olopatadine hydrochloride, 18.80% P407, 0.40% P188, 0.30% Pemulen™TR-1(TR-1), 4.0% mannitol, and 0.08% Tri(hydroxymethyl)aminomethane(Tris).Sterilization was performed at a temperature of 121℃ for a duration of 20 min. Experimental results showed that TP-gel had good safety profile and remained on the ocular surface for approximately (65.83 ± 8.79) minutes, which is four times longer than eye drops. The expression levels of IL-13, IL-17, and OVA-IgE in mouse ocular tissues with allergic conjunctivitis treated with TP-gel were significantly reduced. This suggests that TP-gel has the potential to be an effective treatment method for allergic conjunctivitis.