diff --git a/src/fru_device.cpp b/src/fru_device.cpp
index af53e7f..b4c3668 100644
--- a/src/fru_device.cpp
+++ b/src/fru_device.cpp
@@ -116,9 +116,7 @@
     }
 }
 
-static ssize_t readFromEeprom(int flag __attribute__((unused)), int fd,
-                              uint16_t address __attribute__((unused)),
-                              off_t offset, size_t len, uint8_t* buf)
+static int64_t readFromEeprom(int fd, off_t offset, size_t len, uint8_t* buf)
 {
     auto result = lseek(fd, offset, SEEK_SET);
     if (result < 0)
@@ -189,21 +187,21 @@
     it->second->initialize();
 }
 
-static int isDevice16Bit(int file)
+static std::optional<bool> isDevice16Bit(int file)
 {
     // Set the higher data word address bits to 0. It's safe on 8-bit addressing
     // EEPROMs because it doesn't write any actual data.
     int ret = i2c_smbus_write_byte(file, 0);
     if (ret < 0)
     {
-        return ret;
+        return std::nullopt;
     }
 
     /* Get first byte */
     int byte1 = i2c_smbus_read_byte_data(file, 0);
     if (byte1 < 0)
     {
-        return byte1;
+        return std::nullopt;
     }
     /* Read 7 more bytes, it will read same first byte in case of
      * 8 bit but it will read next byte in case of 16 bit
@@ -213,14 +211,14 @@
         int byte2 = i2c_smbus_read_byte_data(file, 0);
         if (byte2 < 0)
         {
-            return byte2;
+            return std::nullopt;
         }
         if (byte2 != byte1)
         {
-            return 1;
+            return true;
         }
     }
-    return 0;
+    return false;
 }
 
 // Issue an I2C transaction to first write to_slave_buf_len bytes,then read
@@ -256,10 +254,10 @@
     return (ret == SMBUS_IOCTL_WRITE_THEN_READ_MSG_COUNT) ? msgs[1].len : -1;
 }
 
-static ssize_t readBlockData(int flag, int file, uint16_t address, off_t offset,
-                             size_t len, uint8_t* buf)
+static int64_t readBlockData(bool is16bit, int file, uint16_t address,
+                             off_t offset, size_t len, uint8_t* buf)
 {
-    if (flag == 0)
+    if (!is16bit)
     {
         return i2c_smbus_read_i2c_block_data(file, static_cast<uint8_t>(offset),
                                              len, buf);
@@ -285,8 +283,11 @@
 
     std::string errorMessage = "eeprom at " + std::to_string(bus) +
                                " address " + std::to_string(address);
-    std::vector<uint8_t> device = readFRUContents(
-        0, file, static_cast<uint16_t>(address), readFromEeprom, errorMessage);
+    auto readFunc = [file](off_t offset, size_t length, uint8_t* outbuf) {
+        return readFromEeprom(file, offset, length, outbuf);
+    };
+    FRUReader reader(std::move(readFunc));
+    std::vector<uint8_t> device = readFRUContents(reader, errorMessage);
 
     close(file);
     return device;
@@ -431,8 +432,8 @@
             }
 
             /* Check for Device type if it is 8 bit or 16 bit */
-            int flag = isDevice16Bit(file);
-            if (flag < 0)
+            std::optional<bool> is16Bit = isDevice16Bit(file);
+            if (!is16Bit.has_value())
             {
                 std::cerr << "failed to read bus " << bus << " address " << ii
                           << "\n";
@@ -442,12 +443,17 @@
                 }
                 continue;
             }
+            bool is16BitBool{*is16Bit};
 
+            auto readFunc = [is16BitBool, file, ii](off_t offset, size_t length,
+                                                    uint8_t* outbuf) {
+                return readBlockData(is16BitBool, file, ii, offset, length,
+                                     outbuf);
+            };
+            FRUReader reader(std::move(readFunc));
             std::string errorMessage =
                 "bus " + std::to_string(bus) + " address " + std::to_string(ii);
-            std::vector<uint8_t> device =
-                readFRUContents(flag, file, static_cast<uint16_t>(ii),
-                                readBlockData, errorMessage);
+            std::vector<uint8_t> device = readFRUContents(reader, errorMessage);
             if (device.empty())
             {
                 continue;
diff --git a/src/fru_reader.cpp b/src/fru_reader.cpp
new file mode 100644
index 0000000..e381e7e
--- /dev/null
+++ b/src/fru_reader.cpp
@@ -0,0 +1,90 @@
+/*
+// Copyright (c) 2022 Equinix, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
+
+#include "fru_reader.hpp"
+
+#include <cstring>
+
+ssize_t FRUReader::read(off_t start, size_t len, uint8_t* outbuf)
+{
+    size_t done = 0;
+    size_t remaining = len;
+    size_t cursor = start;
+    while (done < len)
+    {
+        if (eof.has_value() && cursor >= eof.value())
+        {
+            break;
+        }
+
+        const uint8_t* blkData;
+        size_t available;
+        size_t blk = cursor / cacheBlockSize;
+        size_t blkOffset = cursor % cacheBlockSize;
+        auto findBlk = cache.find(blk);
+        if (findBlk == cache.end())
+        {
+            // miss, populate cache
+            uint8_t* newData = cache[blk].data();
+            int64_t ret =
+                readFunc(blk * cacheBlockSize, cacheBlockSize, newData);
+
+            // if we've reached the end of the eeprom, record its size
+            if (ret >= 0 && static_cast<size_t>(ret) < cacheBlockSize)
+            {
+                eof = (blk * cacheBlockSize) + ret;
+            }
+
+            if (ret <= 0)
+            {
+                // don't leave empty blocks in the cache
+                cache.erase(blk);
+                return done ? done : ret;
+            }
+
+            blkData = newData;
+            available = ret;
+        }
+        else
+        {
+            // hit, use cached data
+            blkData = findBlk->second.data();
+
+            // if the hit is to the block containing the (previously
+            // discovered on the miss that populated it) end of the eeprom,
+            // don't copy spurious bytes past the end
+            if (eof.has_value() && (eof.value() / cacheBlockSize == blk))
+            {
+                available = eof.value() % cacheBlockSize;
+            }
+            else
+            {
+                available = cacheBlockSize;
+            }
+        }
+
+        size_t toCopy = (blkOffset >= available)
+                            ? 0
+                            : std::min(available - blkOffset, remaining);
+
+        memcpy(outbuf + done, blkData + blkOffset, toCopy);
+        cursor += toCopy;
+        done += toCopy;
+        remaining -= toCopy;
+    }
+
+    return done;
+}
diff --git a/src/fru_utils.cpp b/src/fru_utils.cpp
index 62390c6..99f4aa9 100644
--- a/src/fru_utils.cpp
+++ b/src/fru_utils.cpp
@@ -587,12 +587,11 @@
     return true;
 }
 
-bool findFRUHeader(int flag, int file, uint16_t address,
-                   const ReadBlockFunc& readBlock, const std::string& errorHelp,
+bool findFRUHeader(FRUReader& reader, const std::string& errorHelp,
                    std::array<uint8_t, I2C_SMBUS_BLOCK_MAX>& blockData,
                    off_t& baseOffset)
 {
-    if (readBlock(flag, file, address, baseOffset, 0x8, blockData.data()) < 0)
+    if (reader.read(baseOffset, 0x8, blockData.data()) < 0)
     {
         std::cerr << "failed to read " << errorHelp << " base offset "
                   << baseOffset << "\n";
@@ -620,8 +619,7 @@
     {
         // look for the FRU header at offset 0x6000
         baseOffset = 0x6000;
-        return findFRUHeader(flag, file, address, readBlock, errorHelp,
-                             blockData, baseOffset);
+        return findFRUHeader(reader, errorHelp, blockData, baseOffset);
     }
 
     if (debug)
@@ -633,15 +631,13 @@
     return false;
 }
 
-std::vector<uint8_t> readFRUContents(int flag, int file, uint16_t address,
-                                     const ReadBlockFunc& readBlock,
+std::vector<uint8_t> readFRUContents(FRUReader& reader,
                                      const std::string& errorHelp)
 {
     std::array<uint8_t, I2C_SMBUS_BLOCK_MAX> blockData;
     off_t baseOffset = 0x0;
 
-    if (!findFRUHeader(flag, file, address, readBlock, errorHelp, blockData,
-                       baseOffset))
+    if (!findFRUHeader(reader, errorHelp, blockData, baseOffset))
     {
         return {};
     }
@@ -685,8 +681,7 @@
 
         areaOffset *= fruBlockSize;
 
-        if (readBlock(flag, file, address, baseOffset + areaOffset, 0x2,
-                      blockData.data()) < 0)
+        if (reader.read(baseOffset + areaOffset, 0x2, blockData.data()) < 0)
         {
             std::cerr << "failed to read " << errorHelp << " base offset "
                       << baseOffset << "\n";
@@ -716,8 +711,7 @@
         {
             // In multi-area, the area offset points to the 0th record, each
             // record has 3 bytes of the header we care about.
-            if (readBlock(flag, file, address, baseOffset + areaOffset, 0x3,
-                          blockData.data()) < 0)
+            if (reader.read(baseOffset + areaOffset, 0x3, blockData.data()) < 0)
             {
                 std::cerr << "failed to read " << errorHelp << " base offset "
                           << baseOffset << "\n";
@@ -748,8 +742,8 @@
         size_t requestLength =
             std::min(static_cast<size_t>(I2C_SMBUS_BLOCK_MAX), fruLength);
 
-        if (readBlock(flag, file, address, baseOffset + readOffset,
-                      requestLength, blockData.data()) < 0)
+        if (reader.read(baseOffset + readOffset, requestLength,
+                        blockData.data()) < 0)
         {
             std::cerr << "failed to read " << errorHelp << " base offset "
                       << baseOffset << "\n";
diff --git a/src/meson.build b/src/meson.build
index 8ddb21e..d2959bf 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -32,6 +32,7 @@
         'fru_device.cpp',
         'utils.cpp',
         'fru_utils.cpp',
+        'fru_reader.cpp',
         cpp_args: cpp_args_fd,
         dependencies: [
             boost,
