1. An electronic device comprising: a cache memory including a plurality of cache lines each of which includes a reservation area and a main area with at least one storage space that has a size less than a predetermined size of data storage; and a cache controller configured to: compress the data requested to be stored in the cache memory if a request is made to store data in the cache memory, determine whether the compressed data is equal to or less than the size of one of the at least one storage space of the main area, store the compressed data in one of the storage spaces of the main area if the compressed data is equal to or less than the size of the at least one storage space of the main area, wherein the cache controller is further configured to: divide, the data requested for storage into divided parts of data if the compressed data is greater than the size of one of the storage spaces of the main area and the size of the divided part of data is equal to or less than the size of one of the storage space of the main area and the reservation area, and store one divided part of data in one of the storage spaces of the main area and the other in one of the storage spaces of the reservation area without compression.