Page Speed Optimization Libraries  1.7.30.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions
net_instaweb::CssUrlEncoder Class Reference

#include "css_url_encoder.h"

List of all members.

Public Member Functions

virtual void Encode (const StringVector &urls, const ResourceContext *encoding, GoogleString *rewritten_url) const
virtual bool Decode (const StringPiece &url_segment, StringVector *urls, ResourceContext *dim, MessageHandler *handler) const

Static Public Member Functions

static void SetInliningImages (const RequestProperties &request_properties, ResourceContext *resource_context)
 Sets Inlining of image according to the user agent.

Detailed Description

This class implements the encoding of css urls with optional additional dimension metadata. For the legacy encoding, it used to prepend characters indicating whether the user-agent allows for inlining or webp. We may need to employ distinct CSS files for these types of browsers. This information is conveyed in the ResourceContext. http://..path../W.cssfile... CSS file optimized for webp-capable browsers. http://..path../I.cssfile... CSS file optimzed for for non-webp browsers that inline. http://..path../A.cssfile... Archaic browser (ie6+7) does neither.

Note that a legacy CSS URL beginning with W., I., or A. will be misinterpreted and will not be fetchable since the Decode function will strip off the leading 2 characters.

Note that a lot of this is legacy encoding now, and that we just unconditionally use the "A." encoding and rely on content hash and metadata cache + user-agent sniffing to keep things consistent.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines