Is the wind oscillating (shifting back and forth) or persistent (shifting steadily in one direction)? This is one of the most important strategic questions you should ask yourself (constantly) during any race. The way you answer this question will have a huge impact on how you play each windshift.
Consider a boat that is sailing up the first beat on port tack (see diagram). If that boat sails into a header, should she tack? Not necessarily. It depends on whether her crew thinks the wind is oscillating or persistent. If the wind is oscillating, she should tack because the next shift will come from the left (and a good rule of thumb upwind is to sail toward the next shift). But if she thinks the wind is shifting persistently, she should not tack. In that case her best strategy is to stay on port tack and keep sailing into the persistent shift.
It's critical to have this strategic plan before you get the shift. In other words, don't sail into the shift and then have a discussion about whether the wind is oscillating or persistent. By then it's too late. Be proactive and have the conversation early (and constantly) so that when you get the shift you can quickly respond to it in a way consistent with your strategy.