Previous HN discussion: https://news.ycombinator.com/item?id=18890475
IMO, there's probably some other causal factor(s), and reducing sunlight exposure is not the solution.
Sunlight exposure is important for health, not just for Vitamin D (which others have pointed out, may just be a proxy for some other factor of sun exposure). It's important for regulating circadian rhythm, as well as preventing myopia in childhood.
Why? It is not known, but even when controlling for physical exercise, Vitamin D status, and other factors, the correlation still holds. Some authors suggest other chemicals produced by sunlight, not only Vitamin F, might be involved.
I worked on a product that had a UV sensor. It needed to be protected.
Sourcing glass that didn't block UVB, that could be used in a mass market product, at cost, integrated into a manufacturing line, was a bit of a challenge. The mechanical engineering team eventually got a hold of some. For awhile, there were weekly status updates of "got another manufacturing sample, spec sheet wasn't quite honest, it blocks some UVB."
Physics aside, why would you want to do that in the first place? UVB is the chief cause of skin reddening and sunburn and plays a key role in the development of skin cancer and a contributory role in tanning and photoaging. [1]
Just for that little benefit of triggering Vitamin D synthesis is not worth the increased risk of skin cancer IMO. And the author lays out the alternative there too: "Those concerned about low vitamin D levels can get more of the vitamin through foods. "
[1]: https://www.skincancer.org/prevention/uva-and-uvb