Why is a bubble spherical? Because a sphere is the optimal shape for balancing the pressure inside with the tension on the outer surface, i.e. the maximum gas volume for a given surface of soapy water.
How is this related to the topic at hand? Because when investing over different periods, you want to maximise the compound return for a given compound risk. And there is one optimal way to achieve that result: by having constant risk in a moneyweighted fashion (i.e. the risk you take weighted by the money you invest in).
Having one lump sum is fairly straightforward, as constant risk means a portfolio of (almost) constant proportions: a sort of spherical risk… However, when you add regular and foreseeable contributions, a portfolio of constant proportions means that moneyweighted risk is smaller at the beginning than at the end of your investment period, so you become more sensitive to the timing of market events. Constant (money) risk means riskier assets at the beginning, with a decreasing proportion of risky assets as contributions come in.
Let’s use a concrete example to explain further:

You invest for 10 years

However, you have £1,000 to invest now and another £1,000 to invest in five years from now.
For the sake of clarity, we will assume that expected returns are proportional to risk. This means that each unit of risk taken generates a proportionally equivalent unit of return. Put simply, if you take 50% more risk then you can expect a 50% better return as evidenced below:
Risk (volatility*) in % 
Expected return (%) 

7.50% 
2.25% 
10.00% 
3.00% 
15.00% 
4.50% 
Before we dig further, let us stick to the basics and recall that:

A portfolio return is the capital invested (K) multiplied by the return (R). If E(R) denotes the statistical average (Expected value) of (R), thus the average return of the portfolio is K * E(R)

A maximum loss is a market crash effect on your portfolio that can simplified as the intensity of the crash (L) multiplied by the volatility (vol) itself, multiplied by the capital invested (K): L * vol * K.
So back to business: let us assume you opt for a balanced portfolio with 10% volatility and 3% (per annum) expected return during the 10year holding period (with rebalancing when necessary). Your percent risk will be constant, but the risk to your pound won’t be! Let’s work out why:

Assume that, in one of the coming 10 years, there will be an intensity 2 crash year of 20% for the balanced portfolio

If this event happens during:

the first five years, it means a loss of approximately 20% x £1,000 = £200

the last five years, after you invested an extra £1,000, you lose approximately 20% x £2,000 = £400


Neglecting the compound return effect**:

the average (expected) gain of the portfolio would be 3% x 5 x £1000 + 3% x 5 x £2000 = £450

for a potential maximum loss of £400 (if the crash happens during the second period).

But what happens if we take 50% more risk than the balanced portfolio during the first five years, but half that risk for the last five years to ‘compensate’?
This means we take:

a 10% * (1+50%) = 15% volatility risk portfolio for an expected return of 3% x (1+50%) = 4.50%

a 15% x (150%) = 7.50% portfolio for an expected return of 4.50% x (150%) = 2.25%
Therefore, in this case, the crash year would result in a loss of:

30% on the riskier portfolio 1.5 x 20%

15% on the less risky portfolio (1.5/2) x 20%.
So, based on those elements, what are the effects of choosing the dynamic 15% risk portfolio for the first period, followed by a prudent 7.5% percentrisk portfolio for the second period? Let’s do the maths:

If the crash happens during first period, the loss is approximately 30% x £1,000 = £300

If it happens during the second period, the loss is approximately 15% x £2,000 = £300...

...therefore keeping the maximum pound loss constant throughout at £300...

...at a lower maximum pound loss compared to the constantrisk portfolio one of £400...

...for an expected gain (here again ignoring the compounding effect) of 4.5% x 5 x £1,000 + 2.25% x 5 x £2,000 = £450.
For the same expected money return of £450, we managed to reduce the maximum likely loss by 25% just by varying risk according to the scheduled investment. We made our poundweighted risk spherical again by adapting the portfolio risk to the amount invested. Instead of sticking to a constant percent risk, we stuck to a constant poundweighted risk.
Of course, it is always difficult to plan future investments, especially for distant horizons. However, with foreseeable positive flows of investable money, one should still take more risk at the beginning of the investment period. The reverse is also true: when you know you will be living partly on your savings, you should take less risk at the beginning, letting it increase gradually.
* Volatility: Volatility refers to the amount of uncertainty or risk in the size of changes in a security's value. A higher volatility means that a security's value can potentially be spread out over a larger range of values. This means that the price of the security can change dramatically over a short time period in either direction. A lower volatility means that a security's value does not fluctuate dramatically, but changes in value at a steady pace over a period of time.
**Compounding is the ability of an asset to generate earnings, which are then reinvested in order to generate their own earnings. In other words, compounding refers to generating earnings from previous earnings.