Try these
Golf Hat Sweat Liner & Cap... https://www.amazon.com/dp/B016ZH8I82?ref=ppx_pop_mob_ap_share
These work great for me.
Not saying this works. I have seen these but not tried them.
Golf Hat Sweat Liner – Prevents Stains & Odor - Patented Technology 3 | 6 | 12 | 25 | 50 Pack https://smile.amazon.com/dp/B016ZH8I82/ref=cm_sw_r_cp_api_fabt1_rERQFb94KQKMF