When you sign someone to a big time long term deal the very best you can ever hope for is that you break even with the contract. It is a losing bet for the most part and a terrible way to do business. If I were a GM I would only ever give a big deal to a QB simply because you have to have one to have any chance in the NFL today and there are so very few available. Say what you want about deals for QBs like Dak and Romo but they are necessary and therefore worth it.
After that I would sign OL to long term deals because they are for the most part less prone to injury, less prone to a sudden massive drop off in pay and have longer than usual careers. Deals like Martin and Smith have been overall good for us. I am sure the Frederick deal would have been good if not for crazy health issues. The Collins deal is looking like we sunk money into a bum who does not care about football. 3 out of 4 ain't bad.
After that I would sign CB, pass rushing DE and WR but only the second contract. The third contract puts the players into their 30s and almost always is nothing more than a retirement package. These are high impact skill based positions that are less likely to see massive drops. We have done so so over the years with these contracts. You just gotta be careful but it is pretty much a crap shoot.
After that you stay away from paying out RB, DT and LB. These are high effort, high impact positions that are very prone to injury and massive drop off in quality of play. We have done quite poorly overall with these contracts over the years.
Sign the key players, sign young players, sign 1 year deals, draft well, build depth, these are the ways to be competitive long term.