This paper proposes a novel method of caching contents that can be encoded into multiple quality levels in device-to-device (D2D)-assisted caching networks. Different from the existing caching schemes, the author allows caching fractions of an individual file and considers the self cache hit event, which the user can find the desired content in its device. The author analyzes the tradeoff between the quality of cached contents and the cache hit rate, and proposes the device caching method maximizing the expected quality that the user can enjoy. Depending on the parameter of the relationship between the quality and the file size, the optimal caching method can be obtained by solving the convex optimization problem and the DC programming problem. If the file size increases faster than the quality, the cached fractions of the contents continuously increase as the popularity grows. Meanwhile, if the file size increases slower than the quality, some of the high-popularity files are entirely cached but others are not cached at all.