There are two factors to consider: Cost and availability. They aren't necessarily related.
Example: During WWII, one of the major factors in limiting civilian driving was rubber. Tires were largely unavailable. Fuel wasn't the issue as much as replacement tires. Fast forward to 2022, and we see a supply shortage particularly with regards to motorcycle tires. I run a fleet of motorcycles, and finding the desired tire has been difficult this summer. I am finding that I am now buying tires earlier to ensure I have it on hand when it is needed. This is a response to shortages and supply issues, not inflation. And there is a hard limit on how far Im willing to stockpile a tire. On my personal motorcycle, which if sometimes driven "with great enthusiasm", I'll source and buy new tires six months early (FYI, Avon recommends tire replacement at 7 years beyond manufacture date. All teh other makers I am aware of say 10 years. Buying next year's rubber this year won't be an issue....)
In terms of inflation, it could make sense to buy now. However, you have two 'hidden' costs. 1) Opportunity cost. You have $1,000.00 tied up in auto parts. The $1,000 could be better used as cash, used stockpiling more important things (beans, bullets, bandaids), or used as an hedge against emergencies. 2) storage. If you already have a huge garage or empty basement, have at it. If you've got to reorganize, start buying shelving, etc, the storage costs you money.
I'll readily stockpile a short term supply. My tactic is to keep an eye out for sales. For example, I scored a couple of $45.00 gallon of synthetic motor oil on clearance for $18.00 at Walmart in grades I use. SCORE! I bought all four gallons. But Im not going to ay full retail to stock pile against a perceived inflation risk. It isn't worth tying up that much money on such a rarely used item.