Page Speed Optimization Libraries  1.9.32.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
server_context.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
19 
20 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_SERVER_CONTEXT_H_
21 #define NET_INSTAWEB_REWRITER_PUBLIC_SERVER_CONTEXT_H_
22 
23 #include <cstddef>
24 #include <set>
25 #include <utility>
26 #include <vector>
27 
34 #include "net/instaweb/util/public/md5_hasher.h"
36 #include "net/instaweb/util/public/queued_worker_pool.h"
37 #include "net/instaweb/util/public/ref_counted_ptr.h"
41 #include "pagespeed/kernel/util/simple_random.h"
42 
43 namespace pagespeed { namespace js { struct JsTokenizerPatterns; } }
44 
45 namespace net_instaweb {
46 
47 class AbstractMutex;
48 class AsyncFetch;
49 class CacheHtmlInfoFinder;
50 class CacheInterface;
51 class CachePropertyStore;
52 class CriticalCssFinder;
53 class CriticalImagesFinder;
54 class CriticalLineInfoFinder;
55 class CriticalSelectorFinder;
56 class RequestProperties;
57 class ExperimentMatcher;
58 class FileSystem;
59 class FlushEarlyInfoFinder;
60 class Function;
61 class GoogleUrl;
62 class Hasher;
63 class MessageHandler;
64 class NamedLock;
65 class NamedLockManager;
66 class PropertyStore;
67 class RequestHeaders;
68 class ResponseHeaders;
69 class RewriteDriver;
70 class RewriteDriverFactory;
71 class RewriteDriverPool;
72 class RewriteFilter;
73 class RewriteOptions;
74 class RewriteOptionsManager;
75 class RewriteQuery;
76 class RewriteStats;
77 class SHA1Signature;
78 class Scheduler;
79 class StaticAssetManager;
80 class Statistics;
81 class ThreadSynchronizer;
82 class ThreadSystem;
83 class Timer;
84 class UrlAsyncFetcher;
85 class UrlNamer;
86 class UsageDataReporter;
87 class UserAgentMatcher;
88 struct ContentType;
89 
90 typedef RefCountedPtr<OutputResource> OutputResourcePtr;
91 typedef std::vector<OutputResourcePtr> OutputResourceVector;
92 
101  public:
102  typedef std::pair<RewriteOptions*, bool> OptionsBoolPair;
103 
105  static const int64 kGeneratedMaxAgeMs;
108 
112  static const char kResourceEtagValue[];
113  static const char kCacheKeyResourceNamePrefix[];
114 
116  static const char kStatisticsGroup[];
117 
118  explicit ServerContext(RewriteDriverFactory* factory);
119  virtual ~ServerContext();
120 
131  const ContentType* content_type, StringPiece charset,
132  StringPiece cache_control_suffix, ResponseHeaders* header) const;
133 
134  void set_filename_prefix(const StringPiece& file_prefix);
135  void set_statistics(Statistics* x) { statistics_ = x; }
136  void set_rewrite_stats(RewriteStats* x) { rewrite_stats_ = x; }
137  void set_lock_manager(NamedLockManager* x) { lock_manager_ = x; }
138  void set_enable_property_cache(bool enabled);
139  void set_message_handler(MessageHandler* x) { message_handler_ = x; }
140 
141  StringPiece filename_prefix() const { return file_prefix_; }
142  Statistics* statistics() const { return statistics_; }
143  NamedLockManager* lock_manager() const { return lock_manager_; }
144  RewriteDriverFactory* factory() const { return factory_; }
145  ThreadSynchronizer* thread_synchronizer() {
146  return thread_synchronizer_.get();
147  }
148  ExperimentMatcher* experiment_matcher() { return experiment_matcher_.get(); }
149 
158  void ApplyInputCacheControl(const ResourceVector& inputs,
159  ResponseHeaders* headers);
160 
162  bool IsPagespeedResource(const GoogleUrl& url);
163 
166  const RewriteFilter* FindFilterForDecoding(const StringPiece& id) const;
167 
169  bool DecodeUrlGivenOptions(const GoogleUrl& url,
170  const RewriteOptions* options,
171  const UrlNamer* url_namer,
172  StringVector* decoded_urls) const;
173 
174  void ComputeSignature(RewriteOptions* rewrite_options) const;
175 
177  Hasher* hasher() const { return hasher_; }
178  const Hasher* lock_hasher() const { return &lock_hasher_; }
179  const Hasher* contents_hasher() const { return &contents_hasher_; }
180  FileSystem* file_system() { return file_system_; }
181  void set_file_system(FileSystem* fs ) { file_system_ = fs; }
182  UrlNamer* url_namer() const { return url_namer_; }
183  void set_url_namer(UrlNamer* n) { url_namer_ = n; }
184  RewriteOptionsManager* rewrite_options_manager() const {
185  return rewrite_options_manager_.get();
186  }
187  SHA1Signature* signature() const { return signature_; }
189  void SetRewriteOptionsManager(RewriteOptionsManager* rom);
190  StaticAssetManager* static_asset_manager() const {
191  return static_asset_manager_;
192  }
193  void set_static_asset_manager(StaticAssetManager* manager) {
194  static_asset_manager_ = manager;
195  }
196  Scheduler* scheduler() const { return scheduler_; }
197  void set_scheduler(Scheduler* s) { scheduler_ = s; }
198  bool has_default_system_fetcher() const {
199  return default_system_fetcher_ != NULL;
200  }
201  bool has_default_distributed_fetcher() {
202  return default_distributed_fetcher_ != NULL;
203  }
206  UrlAsyncFetcher* DefaultSystemFetcher() { return default_system_fetcher_; }
207 
208  UrlAsyncFetcher* DefaultDistributedFetcher() {
209  return default_distributed_fetcher_;
210  }
211 
212  Timer* timer() const { return timer_; }
213 
215  void set_timer(Timer* timer) { timer_ = timer; }
216 
217  HTTPCache* http_cache() const { return http_cache_.get(); }
218  void set_http_cache(HTTPCache* x) { http_cache_.reset(x); }
219 
221  void MakePagePropertyCache(PropertyStore* property_store);
222 
223  PropertyCache* page_property_cache() const {
224  return page_property_cache_.get();
225  }
226 
227  const PropertyCache::Cohort* dom_cohort() const { return dom_cohort_; }
228  void set_dom_cohort(const PropertyCache::Cohort* c) { dom_cohort_ = c; }
229 
230  const PropertyCache::Cohort* blink_cohort() const { return blink_cohort_; }
231  void set_blink_cohort(const PropertyCache::Cohort* c) { blink_cohort_ = c; }
232 
233  const PropertyCache::Cohort* beacon_cohort() const { return beacon_cohort_; }
234  void set_beacon_cohort(const PropertyCache::Cohort* c) { beacon_cohort_ = c; }
235 
236  const PropertyCache::Cohort* fix_reflow_cohort() const {
237  return fix_reflow_cohort_;
238  }
239  void set_fix_reflow_cohort(const PropertyCache::Cohort* c) {
240  fix_reflow_cohort_ = c;
241  }
242 
247  CacheInterface* filesystem_metadata_cache() const {
248  return filesystem_metadata_cache_;
249  }
250  void set_filesystem_metadata_cache(CacheInterface* x) {
251  filesystem_metadata_cache_ = x;
252  }
253 
258  CacheInterface* metadata_cache() const { return metadata_cache_; }
259  void set_metadata_cache(CacheInterface* x) { metadata_cache_ = x; }
260 
261  CriticalCssFinder* critical_css_finder() const {
262  return critical_css_finder_.get();
263  }
264  void set_critical_css_finder(CriticalCssFinder* finder);
265 
266  CriticalImagesFinder* critical_images_finder() const {
267  return critical_images_finder_.get();
268  }
269  void set_critical_images_finder(CriticalImagesFinder* finder);
270 
271  CriticalSelectorFinder* critical_selector_finder() const {
272  return critical_selector_finder_.get();
273  }
274  void set_critical_selector_finder(CriticalSelectorFinder* finder);
275 
276  FlushEarlyInfoFinder* flush_early_info_finder() const {
277  return flush_early_info_finder_.get();
278  }
279  void set_flush_early_info_finder(FlushEarlyInfoFinder* finder);
280 
281  UserAgentMatcher* user_agent_matcher() const {
282  return user_agent_matcher_;
283  }
284  void set_user_agent_matcher(UserAgentMatcher* n) { user_agent_matcher_ = n; }
285 
286  CacheHtmlInfoFinder* cache_html_info_finder() const {
287  return cache_html_info_finder_.get();
288  }
289 
290  SimpleRandom* simple_random() {
291  return &simple_random_;
292  }
293 
294  void set_cache_html_info_finder(CacheHtmlInfoFinder* finder);
295 
296  CriticalLineInfoFinder* critical_line_info_finder() const {
297  return critical_line_info_finder_.get();
298  }
299 
301  void set_critical_line_info_finder(CriticalLineInfoFinder* finder);
302 
305  bool store_outputs_in_file_system() { return store_outputs_in_file_system_; }
306  void set_store_outputs_in_file_system(bool store) {
307  store_outputs_in_file_system_ = store;
308  }
309 
310  RewriteStats* rewrite_stats() const { return rewrite_stats_; }
311  MessageHandler* message_handler() const { return message_handler_; }
312 
317  NamedLock* MakeCreationLock(const GoogleString& name);
318 
320  NamedLock* MakeInputLock(const GoogleString& name);
321 
323  bool TryLockForCreation(NamedLock* creation_lock);
324 
328  void LockForCreation(NamedLock* creation_lock,
329  QueuedWorkerPool::Sequence* worker, Function* callback);
330 
332  void set_hasher(Hasher* hasher) { hasher_ = hasher; }
333  void set_signature(SHA1Signature* signature) { signature_ = signature; }
334  void set_default_system_fetcher(UrlAsyncFetcher* fetcher) {
335  default_system_fetcher_ = fetcher;
336  }
337  void set_default_distributed_fetcher(UrlAsyncFetcher* fetcher) {
338  default_distributed_fetcher_ = fetcher;
339  }
340 
347  bool HandleBeacon(StringPiece body,
348  StringPiece user_agent,
349  const RequestContextPtr& request_context);
350 
356  RewriteOptions* global_options();
357 
360  const RewriteOptions* global_options() const;
361 
365  void reset_global_options(RewriteOptions* options);
366 
368  RewriteOptions* NewOptions();
369 
389  bool GetQueryOptions(const RequestContextPtr& request_context,
390  const RewriteOptions* domain_options,
391  GoogleUrl* request_url,
392  RequestHeaders* request_headers,
393  ResponseHeaders* response_headers,
394  RewriteQuery* rewrite_query);
395 
400  static bool ScanSplitHtmlRequest(const RequestContextPtr& ctx,
401  const RewriteOptions* options,
402  GoogleString* url);
403 
408  RewriteOptions* GetCustomOptions(RequestHeaders* request_headers,
409  RewriteOptions* domain_options,
410  RewriteOptions* query_options);
411 
414  GoogleString GetRewriteOptionsSignatureHash(const RewriteOptions* options);
415 
424  RewriteDriver* NewRewriteDriver(const RequestContextPtr& request_ctx);
425 
428  RewriteDriver* NewRewriteDriverFromPool(
429  RewriteDriverPool* pool, const RequestContextPtr& request_ctx);
430 
444  RewriteDriver* NewUnmanagedRewriteDriver(
445  RewriteDriverPool* pool, RewriteOptions* options,
446  const RequestContextPtr& request_ctx);
447 
458  RewriteDriver* NewCustomRewriteDriver(
459  RewriteOptions* custom_options, const RequestContextPtr& request_ctx);
460 
473  void ReleaseRewriteDriver(RewriteDriver* rewrite_driver);
474 
475  ThreadSystem* thread_system() { return thread_system_; }
476  UsageDataReporter* usage_data_reporter() { return usage_data_reporter_; }
477 
481  shutting_down_.set_value(true);
482  }
483 
484  bool shutting_down() const {
485  return shutting_down_.value();
486  }
487 
497  void ShutDownDrivers();
498 
519  void MergeNonCachingResponseHeaders(const ResourcePtr& input,
520  const OutputResourcePtr& output) {
521  MergeNonCachingResponseHeaders(*input->response_headers(),
522  output->response_headers());
523  }
524 
526  void MergeNonCachingResponseHeaders(const ResponseHeaders& input_headers,
527  ResponseHeaders* output_headers);
528 
530  QueuedWorkerPool* html_workers() { return html_workers_; }
531 
533  QueuedWorkerPool* rewrite_workers() { return rewrite_workers_; }
534 
537  QueuedWorkerPool* low_priority_rewrite_workers() {
538  return low_priority_rewrite_workers_;
539  }
540 
545 
548  void InitWorkers();
549 
551  virtual void PostInitHook();
552 
555  static bool IsExcludedAttribute(const char* attribute);
556 
565  return response_headers_finalized_;
566  }
567  void set_response_headers_finalized(bool x) {
568  response_headers_finalized_ = x;
569  }
570 
575  return available_rewrite_drivers_.get();
576  }
577 
579  const GoogleString& hostname() const {
580  return hostname_;
581  }
582  void set_hostname(const GoogleString& x) {
583  hostname_ = x;
584  }
585 
588  void AddOriginalContentLengthHeader(const ResourceVector& inputs,
589  ResponseHeaders* headers);
590 
592  virtual RewriteDriverPool* SelectDriverPool(bool using_spdy);
593 
596  virtual void ApplySessionFetchers(const RequestContextPtr& req,
597  RewriteDriver* driver);
598 
609  virtual bool ProxiesHtml() const = 0;
610 
612  RequestProperties* NewRequestProperties();
613 
616  void DeleteCacheOnDestruction(CacheInterface* cache);
617 
618  void set_cache_property_store(CachePropertyStore* p);
619 
622  void set_decoding_driver(RewriteDriver* rd) { decoding_driver_ = rd; }
623 
625  virtual PropertyStore* CreatePropertyStore(CacheInterface* cache_backend);
626 
631  const GoogleString& cohort_name,
632  PropertyCache* pcache);
633 
639  const GoogleString& cohort_name,
640  CacheInterface* cache,
641  PropertyCache* pcache);
642 
645  const CacheInterface* pcache_cache_backend();
646 
647  const pagespeed::js::JsTokenizerPatterns* js_tokenizer_patterns() const {
648  return js_tokenizer_patterns_;
649  }
650 
653  void ShowCacheHandler(StringPiece url, AsyncFetch* fetch,
654  RewriteOptions* options);
655 
659  static GoogleString ShowCacheForm(StringPiece user_agent);
660 
666  virtual GoogleString FormatOption(StringPiece option_name, StringPiece args);
667 
668  protected:
672  additional_driver_pools_.push_back(pool);
673  }
674 
675  private:
676  friend class ServerContextTest;
677  typedef std::set<RewriteDriver*> RewriteDriverSet;
678 
680  void ReleaseRewriteDriverImpl(RewriteDriver* rewrite_driver);
681 
683  ThreadSystem* thread_system_;
684  RewriteStats* rewrite_stats_;
685  GoogleString file_prefix_;
686  FileSystem* file_system_;
687  UrlNamer* url_namer_;
688  scoped_ptr<RewriteOptionsManager> rewrite_options_manager_;
689  UserAgentMatcher* user_agent_matcher_;
690  Scheduler* scheduler_;
691  UrlAsyncFetcher* default_system_fetcher_;
692  UrlAsyncFetcher* default_distributed_fetcher_;
693  Hasher* hasher_;
694  SHA1Signature* signature_;
695  scoped_ptr<CriticalImagesFinder> critical_images_finder_;
696  scoped_ptr<CriticalCssFinder> critical_css_finder_;
697  scoped_ptr<CriticalSelectorFinder> critical_selector_finder_;
698  scoped_ptr<CacheHtmlInfoFinder> cache_html_info_finder_;
699  scoped_ptr<FlushEarlyInfoFinder> flush_early_info_finder_;
700  scoped_ptr<CriticalLineInfoFinder> critical_line_info_finder_;
701 
705  MD5Hasher lock_hasher_;
706 
709  MD5Hasher contents_hasher_;
710 
711  Statistics* statistics_;
712 
713  Timer* timer_;
714  scoped_ptr<HTTPCache> http_cache_;
715  scoped_ptr<PropertyCache> page_property_cache_;
716  CacheInterface* filesystem_metadata_cache_;
717  CacheInterface* metadata_cache_;
718 
719  bool store_outputs_in_file_system_;
720  bool response_headers_finalized_;
721  bool enable_property_cache_;
722 
723  NamedLockManager* lock_manager_;
724  MessageHandler* message_handler_;
725 
726  const PropertyCache::Cohort* dom_cohort_;
727  const PropertyCache::Cohort* blink_cohort_;
728  const PropertyCache::Cohort* beacon_cohort_;
729  const PropertyCache::Cohort* fix_reflow_cohort_;
730 
736  scoped_ptr<RewriteDriverPool> available_rewrite_drivers_;
737 
739  std::vector<RewriteDriverPool*> additional_driver_pools_;
740 
746  RewriteDriverSet active_rewrite_drivers_;
747 
755  bool trying_to_cleanup_rewrite_drivers_;
756  RewriteDriverSet deferred_release_rewrite_drivers_;
757  bool shutdown_drivers_called_;
758 
761  RewriteDriverFactory* factory_;
762 
763  scoped_ptr<AbstractMutex> rewrite_drivers_mutex_;
764 
767  scoped_ptr<RewriteOptions> base_class_options_;
768 
772  RewriteDriver* decoding_driver_;
773 
774  QueuedWorkerPool* html_workers_;
775  QueuedWorkerPool* rewrite_workers_;
776  QueuedWorkerPool* low_priority_rewrite_workers_;
777 
778  AtomicBool shutting_down_;
779 
781  StaticAssetManager* static_asset_manager_;
782 
785  scoped_ptr<ThreadSynchronizer> thread_synchronizer_;
786 
788  scoped_ptr<ExperimentMatcher> experiment_matcher_;
789 
790  UsageDataReporter* usage_data_reporter_;
791 
793  GoogleString hostname_;
794 
797  SimpleRandom simple_random_;
799  const pagespeed::js::JsTokenizerPatterns* js_tokenizer_patterns_;
800 
801  scoped_ptr<CachePropertyStore> cache_property_store_;
802 
803  DISALLOW_COPY_AND_ASSIGN(ServerContext);
804 };
805 
806 }
807 
808 #endif
Definition: url_namer.h:37
const PropertyCache::Cohort * AddCohort(const GoogleString &cohort_name, PropertyCache *pcache)
const CacheInterface * pcache_cache_backend()
void MergeNonCachingResponseHeaders(const ResourcePtr &input, const OutputResourcePtr &output)
Definition: server_context.h:519
void SetDefaultLongCacheHeaders(const ContentType *content_type, StringPiece charset, StringPiece cache_control_suffix, ResponseHeaders *header) const
void LockForCreation(NamedLock *creation_lock, QueuedWorkerPool::Sequence *worker, Function *callback)
Definition: property_cache.h:186
bool GetQueryOptions(const RequestContextPtr &request_context, const RewriteOptions *domain_options, GoogleUrl *request_url, RequestHeaders *request_headers, ResponseHeaders *response_headers, RewriteQuery *rewrite_query)
Adds property-semantics to a raw cache API.
Definition: property_cache.h:180
Definition: static_asset_manager.h:44
Definition: property_store.h:41
RewriteOptions * GetCustomOptions(RequestHeaders *request_headers, RewriteOptions *domain_options, RewriteOptions *query_options)
void set_critical_line_info_finder(CriticalLineInfoFinder *finder)
Takes ownership of the passed in finder.
virtual void ApplySessionFetchers(const RequestContextPtr &req, RewriteDriver *driver)
virtual bool ProxiesHtml() const =0
bool TryLockForCreation(NamedLock *creation_lock)
Attempt to obtain a named lock without blocking. Return true if we do so.
void set_shutting_down()
Definition: server_context.h:480
static bool ScanSplitHtmlRequest(const RequestContextPtr &ctx, const RewriteOptions *options, GoogleString *url)
RewriteDriver * NewRewriteDriverFromPool(RewriteDriverPool *pool, const RequestContextPtr &request_ctx)
RewriteDriverPool * standard_rewrite_driver_pool()
Definition: server_context.h:574
virtual RewriteDriverPool * SelectDriverPool(bool using_spdy)
Chooses a driver pool based on the request protocol.
void set_decoding_driver(RewriteDriver *rd)
Definition: server_context.h:622
void set_timer(Timer *timer)
Note: doesn't take ownership.
Definition: server_context.h:215
NamedLock * MakeInputLock(const GoogleString &name)
Makes a lock used for fetching and optimizing an input resource.
NamedLock * MakeCreationLock(const GoogleString &name)
const RewriteFilter * FindFilterForDecoding(const StringPiece &id) const
void ShowCacheHandler(StringPiece url, AsyncFetch *fetch, RewriteOptions *options)
RewriteDriver * NewUnmanagedRewriteDriver(RewriteDriverPool *pool, RewriteOptions *options, const RequestContextPtr &request_ctx)
virtual void PostInitHook()
To set up AdminSite for SystemServerContext.
Definition: rewrite_driver_pool.h:34
QueuedWorkerPool * html_workers()
Pool of worker-threads that can be used to handle html-parsing.
Definition: server_context.h:530
static const char kResourceEtagValue[]
Definition: server_context.h:112
static GoogleString ShowCacheForm(StringPiece user_agent)
virtual GoogleString FormatOption(StringPiece option_name, StringPiece args)
bool DecodeUrlGivenOptions(const GoogleUrl &url, const RewriteOptions *options, const UrlNamer *url_namer, StringVector *decoded_urls) const
See RewriteDriver::DecodeUrl.
static const int64 kCacheTtlForMismatchedContentMs
Short lifetime for generated resources fetched with mismatching hash.
Definition: server_context.h:107
RequestProperties * NewRequestProperties()
Makes a new RequestProperties.
void SetRewriteOptionsManager(RewriteOptionsManager *rom)
Takes ownership of RewriteOptionsManager.
static bool IsExcludedAttribute(const char *attribute)
QueuedWorkerPool * low_priority_rewrite_workers()
Definition: server_context.h:537
GoogleString GetRewriteOptionsSignatureHash(const RewriteOptions *options)
bool store_outputs_in_file_system()
Definition: server_context.h:305
bool response_headers_finalized() const
Definition: server_context.h:564
void reset_global_options(RewriteOptions *options)
void MakePagePropertyCache(PropertyStore *property_store)
Creates PagePropertyCache object with the provided PropertyStore object.
bool IsPagespeedResource(const GoogleUrl &url)
Is this URL a ref to a Pagespeed resource?
RewriteOptions * NewOptions()
Makes a new, empty set of RewriteOptions.
Definition: rewrite_driver.h:98
void ManageRewriteDriverPool(RewriteDriverPool *pool)
Definition: server_context.h:671
Definition: server_context.h:100
void ApplyInputCacheControl(const ResourceVector &inputs, ResponseHeaders *headers)
void DeleteCacheOnDestruction(CacheInterface *cache)
QueuedWorkerPool * rewrite_workers()
Pool of worker-threads that can be used to handle resource rewriting.
Definition: server_context.h:533
CacheInterface * metadata_cache() const
Definition: server_context.h:258
Definition: usage_data_reporter.h:35
const GoogleString & hostname() const
Returns the current server hostname.
Definition: server_context.h:579
static const char kStatisticsGroup[]
Default statistics group name.
Definition: server_context.h:116
void ReleaseRewriteDriver(RewriteDriver *rewrite_driver)
Hasher * hasher() const
Definition: server_context.h:177
bool HandleBeacon(StringPiece body, StringPiece user_agent, const RequestContextPtr &request_context)
CacheInterface * filesystem_metadata_cache() const
Definition: server_context.h:247
UrlAsyncFetcher * DefaultSystemFetcher()
Definition: server_context.h:206
void AddOriginalContentLengthHeader(const ResourceVector &inputs, ResponseHeaders *headers)
Collects a few specific statistics variables related to Rewriting.
Definition: rewrite_stats.h:38
RewriteOptions * global_options()
static const int64 kGeneratedMaxAgeMs
The lifetime for cache-extended generated resources, in milliseconds.
Definition: server_context.h:105
RewriteDriver * NewCustomRewriteDriver(RewriteOptions *custom_options, const RequestContextPtr &request_ctx)
void set_hasher(Hasher *hasher)
Setters should probably only be used in testing.
Definition: server_context.h:332
RewriteDriver * NewRewriteDriver(const RequestContextPtr &request_ctx)
Definition: url_async_fetcher.h:33
virtual PropertyStore * CreatePropertyStore(CacheInterface *cache_backend)
Creates CachePropertyStore object which will be used by PagePropertyCache.
Definition: http_cache.h:46
const PropertyCache::Cohort * AddCohortWithCache(const GoogleString &cohort_name, CacheInterface *cache, PropertyCache *pcache)
Definition: rewrite_driver_factory.h:73