# 💥 Spark DataFrame Cache

> Episode of [Programmers](https://podistic.com/podcast/programmers.md) · Published January 11, 2023 · Duration 5:01

- **Listen on Podistic:** https://podistic.com/episode/-spark-dataframe-cache
- **Audio:** https://anchor.fm/s/1330224/podcast/play/63330901/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fproduction%2F2023-0-11%2F306943851-44100-1-0ef5bfe632316.mp3 (audio/mpeg)

## About this episode

In Apache Spark, you can cache a DataFrame in memory using the cache() or persist() method. The cache() method is a shorthand for persist() with the default storage level of MEMORY_ONLY. You can use the persist() method to specify a different storage level if desired, such as MEMORY_AND_DISK or MEMORY_ONLY_SER.
