Do you mean the .LRCAT file is 40Gb?
Or is this the cache, in a subfolder whose name ends with Previews.LRDATA?
its the .LRDATA one
the LRCAT is 1.56Gb
You can control how the previews are created and choose how big they should be and how long they should be kept before they are discarded. All of these can reduce the amount of space needed, but there is a tradeoff, some tasks in Lightroom will take longer if you have smaller previews, or if the previews for an image have been discarded.
These are all options under Preferences.
any tips on where i can find an online tutorial on this?
I really don't know, but I bet your favorite search engine can point you in the right direction.