The logo of Marks & Spencer is seen in front of a store in Paris, France, January 5, 2017. REUTERS/Charles Platiau

LONDON (Reuters) - British retailer Marks & Spencer is to trial an online grocery shopping service this year, it said on Thursday, conceding it could no longer ignore the fastest growing segment of the market.

For years M&S has resisted giving its customers the option of ordering food online for home delivery, saying it did not make economic sense for its offering, which is focused on the “food for tonight” market and tends to be small basket sizes.

But with Britain’s online food market expected to nearly double to 17.2 billion pounds ($22.2 billion) in the five years to 2020, according to industry research group IGD, M&S has now had a change of heart.

“We continue to review food online carefully. It has not cost us anything over the last five years by not being online with food. Our customers haven’t moved yet, but they will and we need to ensure that we are ready with the right response,” said Steve Rowe, M&S’ group chief executive, who used to run its food business.

“There are unanswered questions over what this means for M&S and we have a team looking at this now with a view to undertaking a soft trial in the autumn,” he said in comments first reported by The Guardian newspaper.

Rowe signaled that M&S would carry out extensive trialing before any roll-out of an online grocery service.

“The economics of food online are not straightforward and it is not something that we are going to rush into until we have substantial customer insight and a better understanding of what is right for M&S and right for our customers.”

While M&S’s clothing business has struggled in recent years its food business has thrived.

In November, Rowe detailed plans to close about 30 UK stores selling clothing, homewares and food and downsize or convert another 45 into food stores over five years.