1. An electronic device comprising: a cache memory including a plurality of cache lines each of which includes a first area with at least one storage space and a second area with at least one storage space, wherein the at least one storage space of the first area has a first size and the at least one storage space of the second area has a second size different from the first size; and a cache controller configured to store, when a request is made to store data in the cache memory, the data requested for storing in one of the storage spaces of the first area or the second area, according to a compression factor associated with the data requested for storage.