/*
 * Copyright 2013 Google 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.
 */

// Authors: mmohabey@google.com (Megha Mohabey)
//          pulkitg@google.com (Pulkit Goyal)

// Cache Html Info proto.

syntax = "proto2";

import "net/instaweb/http/http.proto";

option optimize_for = LITE_RUNTIME;

package net_instaweb;

// Protobuf to encapsulate the information use by cache html flow.
// Next id = 7
message CacheHtmlInfo {
  // Cacheable HTML for the given URL with the non cacheable parts stripped
  // based on config. This can potentially be few KBs and could blow out our
  // cache in the presence of a large URL-space due to query-params or large
  // catalogs. Typed "bytes" not "string" as it can contain non-UTF-8 content.
  optional bytes cached_html = 1;

  // Hash of the content used for html change detection full-diff.
  optional string hash = 2;

  // Timestamp when cached html computation was last done.
  optional int64 last_cached_html_computation_timestamp_ms = 3;

  // Hash of the content used for html change detection smart-diff.
  optional string hash_smart_diff = 4;

  // Character-set from the previous response.
  optional string charset = 5;
}
