diff --git a/core/.idea/.name b/core/.idea/.name
new file mode 100644
index 0000000..0f31176
--- /dev/null
+++ b/core/.idea/.name
@@ -0,0 +1 @@
+core
\ No newline at end of file
diff --git a/core/.idea/codeStyleSettings.xml b/core/.idea/codeStyleSettings.xml
new file mode 100644
index 0000000..1129f00
--- /dev/null
+++ b/core/.idea/codeStyleSettings.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectCodeStyleSettingsManager">
+    <option name="PER_PROJECT_SETTINGS">
+      <value />
+    </option>
+  </component>
+</project>
+
diff --git a/core/.idea/core.iml b/core/.idea/core.iml
new file mode 100644
index 0000000..45dcf39
--- /dev/null
+++ b/core/.idea/core.iml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="PHARS">
+        <CLASSES>
+          <root url="phar://$MODULE_DIR$/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar" />
+        </CLASSES>
+        <SOURCES>
+          <root url="phar://$MODULE_DIR$/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+  </component>
+</module>
+
diff --git a/core/.idea/encodings.xml b/core/.idea/encodings.xml
new file mode 100644
index 0000000..e206d70
--- /dev/null
+++ b/core/.idea/encodings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
diff --git a/core/.idea/misc.xml b/core/.idea/misc.xml
new file mode 100644
index 0000000..1162f43
--- /dev/null
+++ b/core/.idea/misc.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" />
+</project>
+
diff --git a/core/.idea/modules.xml b/core/.idea/modules.xml
new file mode 100644
index 0000000..8e03155
--- /dev/null
+++ b/core/.idea/modules.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/core.iml" filepath="$PROJECT_DIR$/.idea/core.iml" />
+    </modules>
+  </component>
+</project>
+
diff --git a/core/.idea/scopes/scope_settings.xml b/core/.idea/scopes/scope_settings.xml
new file mode 100644
index 0000000..922003b
--- /dev/null
+++ b/core/.idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+  <state>
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </state>
+</component>
\ No newline at end of file
diff --git a/core/.idea/vcs.xml b/core/.idea/vcs.xml
new file mode 100644
index 0000000..2e0588c
--- /dev/null
+++ b/core/.idea/vcs.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="" />
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+  </component>
+</project>
+
diff --git a/core/.idea/workspace.xml b/core/.idea/workspace.xml
new file mode 100644
index 0000000..b3b2b34
--- /dev/null
+++ b/core/.idea/workspace.xml
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="d2ea63da-8288-4b4b-8a32-34f064f5c59c" name="Default" comment="">
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/modules/views/lib/Drupal/views/ViewsDataCache.php" afterPath="$PROJECT_DIR$/modules/views/lib/Drupal/views/ViewsDataCache.php" />
+    </list>
+    <ignored path="core.iws" />
+    <ignored path=".idea/workspace.xml" />
+    <file path="/Dummy.txt" changelist="d2ea63da-8288-4b4b-8a32-34f064f5c59c" time="1363681113007" ignored="false" />
+    <file path="/ViewsDataCache.php" changelist="d2ea63da-8288-4b4b-8a32-34f064f5c59c" time="1363626482307" ignored="false" />
+    <file path="/a.php" changelist="d2ea63da-8288-4b4b-8a32-34f064f5c59c" time="1363681242324" ignored="false" />
+    <option name="TRACKING_ENABLED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
+  <component name="CreatePatchCommitExecutor">
+    <option name="PATCH_PATH" value="" />
+  </component>
+  <component name="DaemonCodeAnalyzer">
+    <disable_hints />
+  </component>
+  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
+  <component name="FavoritesManager">
+    <favorites_list name="core" />
+  </component>
+  <component name="FileEditorManager">
+    <leaf>
+      <file leaf-file-name="ViewsDataCache.php" pinned="false" current="true" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/modules/views/lib/Drupal/views/ViewsDataCache.php">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="84" column="0" selection-start="1556" selection-end="1556" vertical-scroll-proportion="-0.116883114">
+              <folding>
+                <element signature="e#7#65#0" expanded="true" />
+                <element signature="e#92#136#0" expanded="true" />
+              </folding>
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
+  </component>
+  <component name="FindManager">
+    <FindUsagesManager>
+      <setting name="OPEN_NEW_TAB" value="false" />
+    </FindUsagesManager>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
+  </component>
+  <component name="GitLogSettings">
+    <option name="myDateState">
+      <MyDateState />
+    </option>
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="changedFiles">
+      <list>
+        <option value="$PROJECT_DIR$/modules/views/lib/Drupal/views/ViewsDataCache.php" />
+      </list>
+    </option>
+  </component>
+  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
+  <component name="ProjectFrameBounds">
+    <option name="y" value="22" />
+    <option name="width" value="1680" />
+    <option name="height" value="940" />
+  </component>
+  <component name="ProjectInspectionProfilesVisibleTreeState">
+    <entry key="Project Default">
+      <profile-state>
+        <expanded-state>
+          <State>
+            <id />
+          </State>
+          <State>
+            <id>Code style issuesJavaScript</id>
+          </State>
+          <State>
+            <id>JavaScript</id>
+          </State>
+        </expanded-state>
+      </profile-state>
+    </entry>
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectReloadState">
+    <option name="STATE" value="0" />
+  </component>
+  <component name="ProjectView">
+    <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
+      <flattenPackages />
+      <showMembers />
+      <showModules />
+      <showLibraryContents ProjectPane="true" />
+      <hideEmptyPackages />
+      <abbreviatePackageNames />
+      <autoscrollToSource />
+      <autoscrollFromSource />
+      <sortByType />
+    </navigator>
+    <panes>
+      <pane id="Scope" />
+      <pane id="ProjectPane">
+        <subPane>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="core" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="core" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="core" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+        </subPane>
+      </pane>
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="options.splitter.main.proportions" value="0.3" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="options.lastSelected" value="preferences.sourceCode.General" />
+    <property name="options.splitter.details.proportions" value="0.2" />
+    <property name="options.searchVisible" value="true" />
+    <property name="GoToClass.includeJavaFiles" value="false" />
+  </component>
+  <component name="RunManager">
+    <list size="0" />
+  </component>
+  <component name="ShelveChangesManager" show_recycled="false" />
+  <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="sslv3">
+    <option name="USER" value="" />
+    <option name="PASSWORD" value="" />
+    <option name="mySSHConnectionTimeout" value="30000" />
+    <option name="mySSHReadTimeout" value="30000" />
+    <option name="LAST_MERGED_REVISION" />
+    <option name="MERGE_DRY_RUN" value="false" />
+    <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
+    <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
+    <option name="IGNORE_SPACES_IN_MERGE" value="false" />
+    <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
+    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
+    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
+    <option name="FORCE_UPDATE" value="false" />
+    <option name="IGNORE_EXTERNALS" value="false" />
+    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="d2ea63da-8288-4b4b-8a32-34f064f5c59c" name="Default" comment="" />
+      <created>1363625961850</created>
+      <updated>1363625961850</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="0" y="22" width="1680" height="940" extended-state="6" />
+    <editor active="true" />
+    <layout>
+      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.14871481" sideWeight="0.6703163" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3296837" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+    </layout>
+  </component>
+  <component name="VcsContentAnnotationSettings">
+    <option name="myLimit" value="2678400000" />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
+    <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
+    <option name="CHECK_NEW_TODO" value="true" />
+    <option name="myTodoPanelSettings">
+      <value>
+        <are-packages-shown value="false" />
+        <are-modules-shown value="false" />
+        <flatten-packages value="false" />
+        <is-autoscroll-to-source value="false" />
+      </value>
+    </option>
+    <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
+    <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
+    <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
+    <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
+    <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
+    <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
+    <option name="SHORT_DIFF_HORISONTALLY" value="true" />
+    <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
+    <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
+    <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
+    <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
+    <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
+    <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
+    <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
+    <option name="LIMIT_HISTORY" value="true" />
+    <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
+    <option name="UPDATE_FILTER_SCOPE_NAME" />
+    <option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
+    <option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
+    <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
+    <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
+    <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
+    <option name="LAST_COMMIT_MESSAGE" />
+    <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
+    <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
+    <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
+    <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
+    <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
+    <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
+    <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
+    <option name="ACTIVE_VCS_NAME" />
+    <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
+    <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
+    <option name="UPDATE_FILTER_BY_SCOPE" value="false" />
+    <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
+    <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager />
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$PROJECT_DIR$/modules/views/config/views.view.archive.yml">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/lib/Drupal/Core/Config/ConfigFactory.php">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="30" column="6" selection-start="833" selection-end="833" vertical-scroll-proportion="0.34285715" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/lib/Drupal.php">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="103" column="25" selection-start="3347" selection-end="3347" vertical-scroll-proportion="0.34285715" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/includes/bootstrap.inc">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="2445" column="20" selection-start="83417" selection-end="83417" vertical-scroll-proportion="0.35194805">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/modules/views/lib/Drupal/views/ViewsDataCache.php">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="84" column="0" selection-start="1556" selection-end="1556" vertical-scroll-proportion="-0.116883114">
+          <folding>
+            <element signature="e#7#65#0" expanded="true" />
+            <element signature="e#92#136#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
+  </component>
+</project>
+
diff --git a/core/modules/views/lib/Drupal/views/ViewsDataCache.php b/core/modules/views/lib/Drupal/views/ViewsDataCache.php
index 15e338c..5daa972 100644
--- a/core/modules/views/lib/Drupal/views/ViewsDataCache.php
+++ b/core/modules/views/lib/Drupal/views/ViewsDataCache.php
@@ -31,6 +31,13 @@ class ViewsDataCache implements DestructableInterface {
   protected $cacheBackend;
 
   /**
+   * The configuration factory object.
+   *
+   * @var \Drupal\Core\Config\ConfigFactory
+   */
+  protected $config;
+
+  /**
    * Storage for the data itself.
    *
    * @var array
@@ -38,87 +45,91 @@ class ViewsDataCache implements DestructableInterface {
   protected $storage = array();
 
   /**
-   * The configuration factory object.
+   * An array of requested tables.
    *
-   * @var \Drupal\Core\Config\ConfigFactory
+   * @var array
    */
-  protected $config;
+  protected $requestedTables = array();
 
   /**
-   * The current language code.
+   * Whether the data has been fully loaded in this request.
    *
-   * @var string
+   * @var bool
    */
-  protected $langcode;
+  protected $fullyLoaded = FALSE;
 
   /**
-   * Whether the data has been fully loaded in this request.
+   * Whether views data has been rebuilt. This is set when getData() doesn't
+   * return anything from cache.
    *
    * @var bool
    */
-  protected $fullyLoaded = FALSE;
+  protected $rebuildAll = FALSE;
 
   /**
    * Whether or not to skip data caching and rebuild data each time.
    *
    * @var bool
    */
-  protected $skipCache;
+  protected $skipCache = FALSE;
 
   /**
-   * Whether the cache should be rebuilt. This is set when getData() is called.
+   * The current language code.
    *
-   * @var bool
+   * @var string
    */
-  protected $rebuildCache;
+  protected $langcode;
 
   public function __construct(CacheBackendInterface $cache_backend, ConfigFactory $config) {
-    $this->config = $config;
     $this->cacheBackend = $cache_backend;
 
     $this->langcode = language(LANGUAGE_TYPE_INTERFACE)->langcode;
-    $this->skipCache = $this->config->get('views.settings')->get('skip_cache');
+    $this->skipCache = $config->get('views.settings')->get('skip_cache');
   }
 
   /**
-   * Gets cached data for a particular key, or rebuilds if necessary.
+   * Gets data for a particular table, or all tables.
    *
    * @param string|null $key
-   *   The key of the cache entry to retrieve. Defaults to NULL.
+   *   The key of the cache entry to retrieve. Defaults to NULL, this will
+   *   return all table data.
    *
    * @return array $data
-   *   The cached data.
+   *   An array of table data.
    */
   public function get($key = NULL) {
     if ($key) {
+      $from_cache = FALSE;
       if (!isset($this->storage[$key])) {
+        // Prepare a cache ID.
         $cid = $this->baseCid . ':' . $key;
-        $data = $this->cacheGet($cid);
-        if (!empty($data->data)) {
+
+        if ($data = $this->cacheGet($cid)) {
           $this->storage[$key] = $data->data;
+          $from_cache = TRUE;
         }
         else {
           // No cache entry, rebuild.
           $this->storage = $this->getData();
-          $this->fullyLoaded = TRUE;
         }
       }
+
       if (isset($this->storage[$key])) {
+        if (!$from_cache) {
+          // Add this table to a list of requested tables, as it's table cache
+          // entry was not found.
+          array_push($this->requestedTables, $key);
+        }
+
         return $this->storage[$key];
       }
+
       // If the key is invalid, return an empty array.
       return array();
     }
     else {
       if (!$this->fullyLoaded) {
-        $data = $this->cacheGet($this->baseCid);
-        if (!empty($data->data)) {
-          $this->storage = $data->data;
-        }
-        else {
-          $this->storage = $this->getData();
-        }
-        $this->fullyLoaded = TRUE;
+        $this->storage = $this->getData();
       }
     }
 
@@ -128,19 +139,17 @@ public function get($key = NULL) {
   /**
    * Sets the data in the cache backend for a cache key.
    *
-   * @param string $key
-   *   The cache key to set.
+   * @param string $cid
+   *   The cache ID to set. The language code will be appended to the key.
    * @param mixed $value
    *   The value to set for this key.
    */
-  public function set($key, $value) {
+  protected function set($cid, $value) {
     if ($this->skipCache) {
       return FALSE;
     }
 
-    $key .= ':' . $this->langcode;
-
-    $this->cacheBackend->set($key, $value);
+    $this->cacheBackend->set($this->prepareCid($key), $value);
   }
 
   /**
@@ -158,26 +167,47 @@ protected function cacheGet($cid) {
       return FALSE;
     }
 
-    $cid .= ':' . $this->langcode;
+    return $this->cacheBackend->get($this->prepareCid($cid));
+  }
 
-    return $this->cacheBackend->get($cid);
+  /**
+   * Prepares the cache ID by appending a language code.
+   *
+   * @param string $cid
+   *   The cache ID to prepare.
+   *
+   * @return string
+   *   The prepared cache ID.
+   */
+  protected function prepareCid($cid) {
+    return $cid .= ':' . $this->langcode;
   }
 
   /**
    * Gets all data invoked by hook_views_data().
    *
+   * This is requested from the cache before being rebuilt.
+   *
    * @return array
    *   An array of all data.
    */
   protected function getData() {
-    $data = module_invoke_all('views_data');
-    drupal_alter('views_data', $data);
+    $this->fullyLoaded = TRUE;
 
-    $this->processEntityTypes($data);
+    if ($data = $this->cacheGet($this->baseCid)) {
+      return $data->data;
+    }
+    else {
+      $data = module_invoke_all('views_data');
+      drupal_alter('views_data', $data);
+
+      $this->processEntityTypes($data);
 
-    $this->rebuildCache = TRUE;
+      // Set as TRUE, so all table data will be cached.
+      $this->rebuildAll = TRUE;
 
-    return $data;
+      return $data;
+    }
   }
 
   /**
@@ -245,13 +275,16 @@ public function fetchBaseTables() {
    * Implements \Drupal\Core\DestructableInterface::destruct().
    */
   public function destruct() {
-    if ($this->rebuildCache && !empty($this->storage)) {
-      // Keep a record with all data.
-      $this->set($this->baseCid, $this->storage);
-      // Save data in seperate cache entries.
-      foreach ($this->storage as $table => $data) {
+    if (!empty($this->storage)) {
+      if ($this->rebuildAll) {
+        // Keep a record with all data.
+        $this->set($this->baseCid, $this->storage);
+      }
+
+      // Save data in seperate, per table cache entries.
+      foreach ($this->requestedTables as $table) {
         $cid = $this->baseCid . ':' . $table;
-        $this->set($cid, $data);
+        $this->set($cid, $this->storage[$table]);
       }
     }
   }
