The sort of nostalgia to which I am most inclined is a nostalgia for particular moments. They might be forty years ago or they might be four months ago. (It usually takes a few months for them to settle into my memory.)
The strange thing is that these moments of nostalgia often have no obvious explanation. I may have been doing something completely mundane when they occur. They might even come at a very stressful time or in the midst of dejection.
Here is my theory: at every moment, we are experiencing and assessing the world according to a multitude of criteria, most of which are dark to our own vision-- that is, we don't even realize we are applying them.
For instance, if we walk into a room, and the colour combination is pleasing to us, we might not even register this consciously. Or perhaps the sound of traffic outside the building is calming at that moment.
Those are only the intrinsic factors, the ones you could list off from examining the particular setting you're in. But there are any number of others. There are psychological factors-- something triggers a memory, an association, a comparison that is somehow pleasing. Or perhaps you were anxious about something which has recently been settled. Or perhaps something in the news that day has pleased you somehow-- it might not even be a good news story, but perhaps a bad news story that you find somehow bracing.
In any case, my theory is that all these factors come together in a given moment, or at least enough of them to cause a flood of wellbeing or excitement or delight. Like a fruit machine with a hundred windows all showing the same fruit at once. (I've never actually used a fruit machine.)
I've noticed that such moments of nostalgia often take years for me to "decipher", and even then they only seem partially deciphered. So perhaps other people are like me in this regard.