Caution:
What constitutes "residency" depends on what it is for, what government body is making the determination. There is no one rule of residency. And, indeed, for most purposes what constitutes residency is not well defined.
For example, CRA rules regarding residency govern CRA determinations of residency, but have no formal or binding effect as to what constitutes residency for other purposes, and residency determinations for CRA purposes are very fact specific to the individual, and will even vary depending on the individual's tax status in other jurisdictions.
Indeed, a person can be a resident of Canada for taxation purposes while spending very little time in Canada, or can be a non-resident even though spending most of the year in Canada; depends. In contrast, for purposes of meeting the Ontario health care benefits residency requirement, one has to be both a "resident" and physically present in Canada at least 153 days in the calendar year. What constitutes being a "resident" in the OHIP context, however, is not well defined. But that is true for many if not nearly all "residency" qualifications . . . from drivers licenses to entitlement to residential tuition. Many have minimum thresholds, like OHIP has the 153 days actual presence threshold, or presumptions, like CRA has the presumption of residency if 183+ days are spent in Canada, or other criteria which is ordinarily relied on (for some purposes showing a drivers license and some other document, like a utility bill, with an address is sufficient to be considered meeting a residency requirement . . . and for some, like many libraries which provide certain services to residents, just a drivers license showing an address within the relevant jurisdictional boundaries).
For purposes of citizenship applications:
Under the 3/4 rule, the requirement specifically was "residency," even though this was never adequately defined and even this month Federal Court Justices have railed, in official decisions, about the problems with defining residency. But even under a physical presence standard, residency itself is a huge, huge factor. The absence of strong indication of residence tends to suggest an absence of presence. In contrast, strong evidence of residence and extensive residency ties, supports a claim of actual presence.
Even if the current IRCC is not specifically enforcing the intent-to-reside requirement, extended absence outside Canada tends to indicate residence outside Canada and can raise questions about to what extent the applicant might have been outside Canada more than declared. Remember, it was under the prior Liberal government leadership that CIC introduced indications of extended absence while the application was pending as a risk indicator, a reason-to-question-residency, long before the Conservative government got all hot-and-bothered about targeting those who appeared to apply-on-the-way-to-the-airport.
There are, as well, logistical considerations, like making sure to get notices from IRCC and being able to respond to them timely, including showing up for a scheduled interview.
Travel outside Canada is NOT restricted. But there can be problems if there is either frequent or extended time spent abroad. Some have run into bigger problems than others, and sometimes these are serious problems. It is up to the individual to decide based on their own situation. But in general it is probably prudent to delay extended absences until after becoming a citizen.