The town of Caerphilly, even the county borough in which it is now situated, is inextricably linked to the massive Medieval castle that stands in the centre of the community.
The town grew up in the wake of the castle and although its military value has long since passed into history, the castle and town have to be viewed together, almost as an entity.
Situated just seven miles north of Cardiff at the southern end of the Rhymney Valley, the military value of the site has been long recognised.
The Romans built a substantial fort here in around 75 AD – a somewhat exposed fortress guarding the rich, flat plains along the Bristol Channel.
It was hardly the ideal posting for the Roman auxiliary troops, the soldiers inside its earth and wooden stockade bending their backs against the Welsh wind, watching steadily for incursions from the tribes in the north.
The fort was occupied until the middle of the 2nd century and then abandoned in favour of other, more hospitable locations.
Rumour and local legend state that St Cenydd built a monastery here but there is little evidence to support the claim. However, the early Christian saint does seem to have given one version of his name, Senghenydd, to the district.
At the same time many people believe that St Cenydd's son, St Ffili, built himself a fort in the area (the Welsh word for fort is caer). If the story is true then it’s easy to see where the name Caerphilly originated.
Caerphilly's development really began with the arrival of the Normans in the 11th century. The Welsh chieftain in the area was called Ifor Bach and the Norman Lord was Gilbert de Clare or Gilbert the Red Earl as he was known.
The de Clare family took control of the region in 1266 when the forces of the Red Earl defeated Gruffyd ap Rhys - the grandson of Ifor Bach.
Warfare between the Normans and the native Welsh was constant and in April 1268 Gilbert de Clare began to build what became Caerphilly Castle in order to protect his holdings in the Senghenydd area.
Caerphilly Castle by Steve Hughes.
Its construction was delayed by an attack from Llewellyn ap Gruffudd but by the end of the century the castle, as we see it today, was virtually complete.
It remains the second largest castle in Britain (behind Windsor Castle) and is regarded as one of the best examples of a medieval concentric design castle.
The town of Caerphilly grew slowly but steadily in the shadow of the castle walls as tradesmen and shop keepers flocked to the place to sell and make their goods and to obtain protection should there be an attack from the warlike Welsh.
In 1316 the tiny community was burned and destroyed by the forces of Llewelyn Bren.
However the Welsh chieftain failed to capture the castle, despite allegedly having a force of 10,000 men at his disposal.
The town was soon rebuilt and by the Middle Ages it had become a small but well-established settlement.
As he did with so many other English fortresses and communities in Wales, Owain Glyndwr captured Caerphilly in the early 15th century but even this could not stop the town developing and progressing.
Wars and warriors passed but the people of Caerphilly simply buried their heads and carried on doing what they did best – making a living.
By the 14th century the place was beginning to acquire a position of some importance in the county of Glamorgan and soon gained burgher status.
The court house is the only remaining building dating from that period and has since been used as a tavern but as the years went on the town became increasingly important as a market and trading centre.
Caerphilly only played a minor role in the Civil War but it is possible that the castle was slighted in the wake of the conflict.
The famous leaning tower which is at an angle greater than the Leaning Tower of Pisa probably owes its architectural uniqueness more to subsidence than it does to the activities of Cromwell's soldiers.
But its peculiar shape and perilous position have certainly given rise to some fascinating stories (usually told to incredulous tourists) over the years.
In the 17th and 18th centuries the condition of the castle deteriorated as townsfolk helped themselves to stones from the structure to help build their own houses and dwellings.
It took the 3rd Marquess of Bute to begin restoring the castle, just as he did with nearby Castell Coch and Cardiff Castle.
This cheese was popular with miners who would wrap it in a cloth and take it underground
In 1741, the Methodist leader George Whitfield was married in Caerphilly while the creation of Caerphilly cheese soon made the name of the town famous throughout the world.
A hard and durable cheese, Caerphilly was originally intended as a food for miners who would wrap it in a cloth and take it with them below ground.
Despite its significance as a market centre, it was the coming of these coal miners to the area that really gave the town of Caerphilly an economic boost.
As the Industrial Revolution gathered momentum there were soon numerous mines in the valleys around the town. The coming of the railways other industries also quickly added to the importance of the town.
The railway station opened in 1871 and for many years Caerphilly was proud to house the railway works of the Rhymney Railway. Never forgetting its Welsh background, in 1950 the town hosted the National Eisteddfod.
As far as culture is concerned, however, the town will always be remembered as the birth place of one of Britain's most unique and best-loved comedians, Tommy Cooper.
These days Caerphilly is something of a dormitory town for Cardiff and Newport. The mines and industry have, largely, gone but the castle is still at the centre of the community but as a tourist attraction rather than a fortress.
With annual events like The Big Cheese Festival and the winter Festival of Light, people still visit the town in their droves.
Caerphilly has always been a ‘big’ town, with a hugely impressive castle and with its connections to one of the most popular cheeses in Britain - is likely to remain so for many years to come.