Best time to cook chicken, to keep it from going off Assuming no use of freezer, or desire to salt-cure/pickle/etc.

From how I was brought up, if I notice a piece of meat in my fridge is going to go off in the next ~24 hours; I'll always try to cook it so I can hold it for a couple more days (refrigerated again).

Intuitively, this makes sense - cooking the meat kills most of the bacteria and so gives more time before they build up the dangerous levels again. However, I am also aware that the bacteria cause toxins to build up - and those will make me sick at some point - so it is not as simple as just "resetting" the storage time by cooking the food.

I'm trying to figure out; when is the best time to cook meat that I know I won't be able to use in time - in order to keep it the longest?

To be clear - I'm looking to prolong the time I can keep the meat in total, without putting myself at serious risk of food poisoning.

Example:


I have some raw chicken.
It has a use-by date, of 4 days from now (and for this, we trust that is a reliable date - as it has proven to be for me in past experience)
General consensus is that cooked food will be safe for 4 days in the fridge. See stack answer


Can I keep the raw chicken until day 4 (the day it says it will go off), and then cook it to get another 4 days cooked-storage time, giving 8 days total?

Or, does the initial storage time affect the cooked time; meaning that I should only store it for say, 2 days, and then cook it - giving me 6 days?

Noting that at the extreme end; if I cooked it immediately, I would have 0 days raw storage, and then only 4 days cooked time - giving me just 4 days total. Which is clearly not ideal (no advantage to cooking).



Compared to existing questions and answers:

There are a lot of really detailed answers on SE already about how long food can be kept in the fridge, or kept once cooked. There are also good answers on how you cannot cook food that's already gone-off, to save it, due to the toxins built up already (and that not all bacteria is killed).

However, the part I am struggling to do - is combine this information to know: "If I have a piece of raw chicken, that will go off in 4 days - and from USDA I know a cooked piece of chicken will last 4 days - when is the best time to cook it, to give me the longest total lifespan?"

This answer details how long things can be kept, but not whether the cooked and raw times add together, or affect each other.

This answer details how cooking food doesn't get rid of toxins, and suggests I can't just wait till the use-by and then cook it.

This answer details how cooking gives you a new amount of safe time, which doesn't seem to work with the above.
The best time to cook is "now" as it gives germs less time to multiply.

If you have a slow cooker, sous-vide set-up, you can keep the cooked meat for up to 21 days in the fridge (for months in the freezer).

I must direct you to this previous question for more info on food safety.

Edit: If your goal is, as stated, to maximize the time you have chicken in your fridge without getting sick, 3 days + 4 days will give you seven days. However, from a food quality point of view, cooking "now" will give you more satisfaction.

Something else... you don't know how long the chicken has been dead already. I've seen some nasty looking chicken at butchers. If the skin looks dry, it has been dead for some time already.