The shrine of Ridi Vihare has its beginnings in a series of cave dwellings on the rocky hillside. In the early days of Buddhism these were once inhabited by meditating monks. Numerous Brahmi inscriptions record the donation of caves for the use of the Sangha and at one time there were thought to be nearly 500 priests residing in the caves on the hillside.
According to the Mahavamsa, the story of Ridi Vihare begins during the reign of King Dutu Gemunu. The greatest king of Anuradhapura, Dutu Gemunu was the first ruler to bring the whole island under his sway. His last work was the monumental Ruvanvelisaya dagaba, the Mahathupa or "Great stupa". However, the construction of the Mahathupa proved to be a huge task and the cost threatened to drain the country's resources. The king was deeply troubled by this and wondered how he was going to find the money to complete his dream. In answer to his prayer an enormous quantity of silver was discovered in the "Ambatthakola" cave where Ridi Vihare now stands.
At that time, Ridi Vihare, which was only 55 miles south of Anuradhapura, lay on one of the main routes from the Raja Rata to the Malaya Rata, from the dry zone to the hill country. A merchant from the city, taking many wagons with him, in order to bring ginger and so forth from Malaya, had set out for Malaya. Not far from the cave he brought the wagons to a halt and since he had need of wood for whips he went up the mountain.
As he saw here a branch of a breadfruit tree, bearing one single fruit as large as a water pitcher, and dragged down by the weight of the fruit, he cut the fruit... thinking "I will give the first produce as alms".
Almost immediately several arhats appeared to whom the merchant offered the fruit as Dana (alms). After they had eaten their fill they went their way, whereupon four more arhats took their places. They too ate their share and three of them left. One however did not leave, taking his alms bowl with him he sat some distance away. When he had eaten his meal the merchant went in search of the arhat and found him seated outside a nearby cave. As he approached, the arhat opened a path to the mouth of the cavern and commanded him to follow it "Go thou now also on this path, lay brother". On entering the cave, the merchant found that it was full of silver and he broke a lump off with his axe. Leaving his wagons behind, he made haste to Anuradhapura to show the king what he had found. The vein of silver turned out to be a very rich one and provided King Dutu Gemunu with the wherewithal to complete the Ruvanvelisaya.
Although the Mahavamsa does not actually say so, the story goes that the king built a vihare on the spot where the jackfruit was offered. This vihare was named the Varaka Velandhu Vihare, "the vihare where the jakfruit was eaten".