also cheese-cake, mid-15c., from cheese (n.1) + cake (n.). Originally a cake or tart containing cheese, later one made with sweetened soft curds, etc. It was used figuratively for "soft, effeminate" from 18c.
The modern slang meaning dates from 1933; a "Time" magazine article from 1934 defined it as "leg-pictures of sporty females." In its early years this sense of the word often was associated with Marlene Dietrich. "A number of fanciful theories about its origins have been put forward, none of which carry sufficient conviction to bear repeating" [John Ayto, "The Diner's Dictionary"].