Image copyright Getty Images

Avoided by some, worshipped by others - the sun's relationship with health-conscious humans is a delicate one. Attitudes towards the sun's rays have swung almost full circle in a little over 100 years

At the start of the 20th Century, the British Establishment feared the sun, especially in warmer reaches of the Empire.

It was thought that bright sunlight - plus a generally hot and humid climate - could cause a condition known as tropical neurasthenia among pale-skinned Brits. The symptoms included fatigue, irritability, insanity and even death.

Image copyright Wellcome Library Image caption Boer War soldiers, circa 1900 (Wellcome Library)

For military men, the round, lightweight pith helmet was worn to try to prevent the sun's rays from striking the head.

According to Simon Carter, sociologist and author of Rise and Shine: Sunlight, Technology and Health, while the science basis for diagnosis was slim, a whole medicine industry grew up around tropical neurasthenia. The narratives focused on the health sacrifices made by those people "who travelled to take civilisation to the colonies".

Image copyright Getty Images Image caption British troops wear pith helmets in China - during the Boxer Rebellion, 1900 (Getty Images)

At home too, the notion of getting a tan - in polite society at least - was not fashionable. Products went on sale which claimed to remove accidental tans, which women might have acquired while outside.

Image copyright Wellcome Library Image caption Advertisement for Rowland's Kalydor, circa 1915 (Wellcome Library)

Healing rays?

Around the same time though, parallel ideas were emerging supporting the theory that sunlight might be useful medically - harnessing the bacteria-killing properties of the sun's rays.

Heliotherapy, which is sometimes called phototherapy, saw patients with skin-based conditions exposed to prolonged sunlight. And when sunlight was not guaranteed, artificial alternatives emerged - known as actinotherapy.

The Finsen ultraviolet lamp, invented by Niels Ryberg Finsen in the late 1800s, was used successfully to treat Lupus vulgaris - tuberculosis of the skin.

Image copyright Wellcome Library Image caption Finsen lamp treatment, 1925 (Wellcome Library)

Sunlight therapy was also used in the UK on children to prevent and treat rickets, a condition which affects bone development.

Today it is known that as well as spending some time in sunlight, rickets can easily be prevented by eating a diet that includes vitamin D and calcium.

But in the 1930s, many schools got sunlamps, and some taught classes outside. Some animals ended up receiving similar treatment.

Image copyright Getty Images Image caption Dogs receive sunlamp treatment for rickets and a leg injury, 1949 (Getty Images)

The sun indoors

A whole industry grew up around domestic actinotherapy. Portable sunlamps for home use were advertised - promoting apparent health benefits.

Image copyright Wellcome Library

Image copyright Wellcome Library Image caption Actina portable sun lamp - and non-flam folding goggles (Wellcome Library)

Companies claimed it was a way of getting summer in winter.

The trend was changing - having a brown body, compared with paler "sun-starved" skin, was becoming more desirable.

Image copyright Wellcome Library Image caption Leaflet for the "Vi-Tan" ultra-violet home unit, 1936 (Wellcome Library)

Aesthetic catalogue illustrations suggested consumers could bring the outdoors into their homes.

Image copyright Wellcome Library

Image copyright Wellcome Library Image caption Homesun UV lamp advert, 1937 (Wellcome Library)

Alpine therapy

This next striking poster - full of colour and energy - promoted the sunshine and fresh air in the Swiss town of Leysin. High in the mountains, the resort was home to a sanatorium, one of several set up by sun-therapist Auguste Rollier.

He argued that sunlight could help fight general tuberculosis and other illnesses - not just conditions which affected the skin.

Image copyright Wellcome Library Image caption Promoting the town of Leysin in Switzerland for treatment of TB, circa 1930 (Wellcome Library)

The clinic - now part of Leysin American School - was built so that each room had a balcony, on which patients could sit and catch the sun's rays all year round, even in winter.

Rollier prescribed that patients should be introduced gradually to sunlight for a set length of time each day, so they could build up resistance and not burn.

Because this type of treatment for TB was non-invasive it proved particularly popular - given that alternatives at the time involved painful invasive operations.

Image copyright Wellcome Library Image caption Building that used to house Rollier's sanatorium in Leysin, Switzerland (Simon Carter)

For most British people travelling to Switzerland for the Rollier experience was expensive - and so, despite it not being quite so sunny, sanatoria were also set up in the UK.

This photograph shows children at Alton in Hampshire. Typically, wards had French windows - so that on sunny days patients could be wheeled out.

Image copyright Wellcome Library Image caption Child patients lying in the sun as part of their heliotherapy, 1937 (Wellcome Library)

Lido lovers

In the inter-war period, as more rights and benefits were offered to workers - like paid holidays - families were able to travel out on sunny days to the countryside or the coast.

The popularity of lidos - outdoor swimming complexes built as part of public works programmes - also grew.

Image copyright Getty Images Image caption Saltdean Lido, East Sussex, 1940s (Getty Images)

Lidos offered families a more informal experience than they had been used to.

Carter describes them as "slightly anarchic" compared with the traditional indoor pools which existed at the time. People wore costumes made out of new fabrics that left more flesh on show.

Image copyright Getty Images Image caption Bathers at the Serpentine Lido in Hyde Park, London, circa 1955 (Getty Images)

Rub it in

As more people bathed in the sunshine - the first sun creams were marketed.

Image copyright Getty Images Image caption Man rubs suntan lotion on his wife's back while she drinks tea, circa 1935 (Getty Images)

They aimed merely to let people tan more easily without burning. There was no mention of protecting the skin from the sun's rays.

Image copyright Wellcome Library Image caption Sun cream advert, 1930s (Wellcome Library)

There was still though - says Carter - a recognition of the potential dangers of the sun on fair skin in warmer latitudes.

By World War Two the diagnosis of tropical neurasthenia was dying out, but this image from the time warns soldiers who were being sent to regions where there was strong intense sunlight.

Image copyright Wellcome Library Image caption Illustration in an RAF booklet, 1943 (Wellcome Library)

A fortnight on the Costas

The leisure industry which had grown between the wars stepped up a gear in the 1960s and 70s.

Cheaper air travel and increased disposable income meant people could head abroad more easily - the package holiday was born.

Image copyright ALAMY Image caption Holidaymakers on a beach in Greece, 1977 (Alamy)

The SP Factor

Several chemists are credited with having developed versions of sun block creams - but it was Austrian-born scientist Franz Greiter who developed the Sun Protection Factor ratings which remain today.

He invented the numerical system in 1962 - but it was not until the mid 1970s that most bottles of sun cream started to display the SPF ratings.

Image copyright Getty Images Image caption Applying sun cream on a beach in Florida, USA (Getty Images)

Cancer connection

By the 1980s and into the 90s, countries launched public health campaigns to try to warn of the links between skin cancer and sun exposure.

Australia's "slip, slop, slap" campaign was among the most successful - in a hot country filled with many fair-skinned people of north European extraction.

Sun worshippers were advised to "slip on a shirt, slop on some sunscreen and slap on a hat". The message has been mimicked across the world.

Image copyright ALAMY Image caption Poster in Australia advising parents to follow the slip-slop-slap code (Alamy)

Optimum exposure?

Now, in a new millennium, the medical thinking is changing once again, says Carter.

Campaigns to reduce sun exposure have successfully cut skin cancer rates, but there's concern that some people are not absorbing enough vitamin D from the sun's rays - which is essential for strong bones and general health.

Over the 100 or so years looked at here, says Carter, we have gone from strict sun avoidance, to sunlight being promoted vigorously, to somewhere in between.

There may be an "optimum sun exposure" time for our bodies. But discovering what that might be for each of us may still be some way off.

Image copyright Getty Images Image caption Sunburnt back on a beach in Cornwall, UK (Getty Images)

The Open University's Simon Carter is a speaker at this weekend's 'On Light' series of free public events at the Wellcome Collection and UCL in central London - which looks at the human relationship with light. Runs 1-4 May 2015.

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.