Академический Документы
Профессиональный Документы
Культура Документы
ProjectScope
TestingInstructions
Hostnamespoofing
Verifycachingrules
Prerequisites
ViewAkamaiheaders
Examples
ProjectScope
SiteSpecificConsiderations
AkamaiEnvironment:Staging
DigitalProperty:
[
www.example.com
]
Akamaistagingedgehostname:
[
www.example.com.edgesuitestaging.net
]
StagingIP:[
1.2.3.4
]
Akamaiproductionedgehostname:
[
www.example.com.edgesuite.net
]
ProductionIP:[
5.6.7.8
]
TestingInstructions
Whatfollowsareinstructionsfortesting<
www.example.com
>ontheAkamaistaging
network.Thesameprocesscanbeusedtotestallothersitesthatwouldbeapartof
theAkamaiintegrationscope.Wecanplanthegoliveaftersuccessfulcompletionof
testing.
ThesesamestepscanbeusedforAkamaiProduction,youwouldjustneedtomake
sureyouuseanAkamaiProductionEdgeHostnameasoutlinedearlierinProject
scope.
HostnameSpoofing
Testingacrossthe
staging
network(andalsothe
production
networkbeforethesitehas
beenCNAMEdover)isdoneby
spoofingyourhostnametothecorrespondingAkamai
edgehostname
.Theeasiestwaytoachievethisisbymodifyingthehostsfileonyour
PCtoforceDNSlookuptoadifferentIPaddress.Thiswillrouterequestsonyourlocal
machinetoaspecifiedIPaddress,insteadofanIPresolvedonthepublicinternet.
InstructionsonhowtospooftesttoAkamaiedgehostname,asfollows.
Tomodifyhostsfile
:
1.OpenthehostsfileonyourOS.
WindowsXP/Vista/7islocatedat
%SystemRoot%\system32\drivers\etc\hosts
UnixbasedsystemsandMacOSX:
/etc/hosts
2.Inthehostsfile,youwillwanttoaddanewlineatthebottomintheformat
<IP><hostname>
"
IPistheresolvedIPoftheAkamaiStagingserverusingnslookupcommand.
Oncommandprompt,Nslookup<hostname>.edgesuitestaging.netreturns<IP>
<Hostname>isthedigitalproperty
Forexample:x.x.x.x
www.example.com
"
Bymodifyingthehostsfileonyourcomputer,whenyoutype
www.example.com
inyour
browser,itwillconnecttotheAkamaiserveratthedefinedIPtorequestcontentfrom
there.
NOTE
:
TheStagingNetworkisbasedoutofthe
US
.Whentestingonstaging,theIPaddress
retrievedisaStagingserverIP,whichwouldbeaUSIP.Thisshouldprimarilybeused
totestthebasicfunctionalitiesofthesiteandnotperformance.
OncewepromotetheconfigstoProduction,wewouldbeabletoseethenearest
AkamaiEdgeServerIPservingyourrequest.
VerifyCachingrules
Toverifycachingrules,you'llneedtouseFirefoxpluginslikeModifyheaders,Live
HTTPHeaders,etctoviewHTTPheaders.Pleasereferthebelowsections,toseehow
theAkamaiheaderscanbeseenusingsomebrowserplugins.
Prerequisites
ProxyorHeaderModificationTool
Theabilitytoaddheaderstoabrowserrequestisveryimportantfortesting
Akamaisolutions.Thiscanbedoneinavarietyofways.IfanHTTPProxy
(
Charles
,
Fiddler
)isused,thenitisrelativelystraightforwardtoaddthese
headerstoarequest.Anotherwaytoaddheaderstoabrowserrequestisto
installaheadermodificationplugin(LiveHTTPHeaders,ModifyHeaders)within
yourpreferredwebbrowser.
ViewAkamaiheaders
Viewingtheheadersyoureceivebackfromawebrequestisalsoveryimportant.
TheHTTPproxiesmentionedabovewillallowforthisbehavior.Alternatively,the
DeveloperToolsonSafari,Chrome,IE(8+)andFirefoxshowtheseheadersas
well.
HereareinstructionsonhowtoviewAkamaispecificheadersusingMozilla
Plugins
ModifyHeaders
/
Firebug
.
1. OpenMozillaFirefox.GotoTools>Addons>Extensions.
2.TypeModifyHeadersinsearchboxandinstallthelatestModifyheaders
plugin.RestartFirefox.
3.Oncestep2isdone,GotoTools>WebDeveloper>ModifyHeaders
option.Anewwindowwillopen.
4.Intheheaderssection,kindlyenterthebelow.
SelectActionAdd
NamePragma
Value
akamaixcacheon,akamaixcacheremoteon,
akamaixgetcachekey,akamaixgettruecachekey
Clickonsaveandenablethesame.
5.RestartthebrowserandaccesstheURLs.YoucanuseFirebugorLive
HTTPheaderstoviewtheAkamaiheaders.
Thebelowsectiondescribesthemeaningofthe
variousvaluesreturnedintheXCache
pragmaheader
.
TCP_HIT
:Theobjectwasfreshincacheandobjectfromdiskcache.TCP_MISS:The
objectwasnotincache,serverfetchedobjectfromorigin.
TCP_REFRESH_HIT
:Theobjectwasstaleincacheandwesuccessfullyrefreshedwith
theoriginonanIfModifiedSincerequest.
TCP_REFRESH_MISS
:Objectwasstaleincacheandrefreshobtainedanewobject
fromorigininresponsetoourIFModifiedSincerequest.
TCP_REFRESH_FAIL_HIT
:Objectwasstaleincacheandwefailedonrefresh
(couldn'treachorigin)soweservedthestaleobject.
TCP_IMS_HIT
:IFModifiedSincerequestfromclientandobjectwasfreshincacheand
served.
TCP_NEGATIVE_HIT:
Objectpreviouslyreturneda"notfound"(oranyothernegatively
cacheableresponse)andthatcachedresponsewasahitforthisnewrequest.
TCP_MEM_HIT
:Objectwasondiskandinthememorycache.Serverserveditwithout
hittingthedisk.
TCP_DENIED
:Deniedaccesstotheclientforwhateverreason
TCP_COOKIE_DENY
:Deniedaccessoncookieauthentication(ifcentralizedor
decentralizedauthorizationfeatureisbeingusedinconfiguration)
Examples
Pleasefindanexamplebelowwithsampleresponseheaders,includingthecustom
PragmaAkamaiheaders.
HTTPRequest
http://www.mppc.in/mppc/images/ClientImages/tenxlabslogo.png
HTTPResponse
HTTP/1.1200OK
AcceptRanges:bytes
Connection:keepalive
ContentLength:8023
ContentType:image/png
Date:Tue,30Dec201405:36:03GMT
ETag:"8aaa6f151ed6ce1:0"
LastModified:Thu,31Oct201309:46:33GMT
Server:MicrosoftIIS/7.5
XAkamaiRequestID:3bc3ef
XAkamaiStaging:EdgeSuite
XCache:
TCP_MEM_HIT
froma63141193236.deploy.akamaitechnologies.com
(AkamaiGHost/7.0.4.214498595)()
XCacheKey:/L/16382/348331/
1d
/originwww.mppc.in/mppc/images/ClientImag
es/tenxlabslogo.png
XCheckCacheable:YES
XPoweredBy:ASP.NET
XSerial:16382
XTrueCacheKey:/L/originwww.mppc.in/mppc/images/ClientImages/tenxlabslo
go.png
IntheHTTPrequest/responsesampleabove,"TCP_MEM_HIT"refersto
objectbeingondiskandinmemorycache,Akamaiserverservedthis
withouthittingthedisk."1d"inXCacheKeyheaderindicatesthatthe
contentiscachedatAkamaifor1day.
TheheaderXCheckCacheablewithvalue"YES"indicatesthatthe
contentiscacheable.
TheheaderXAkamaiStaging:Edgesuiteindicatesthatthecontentis
servedoverAkamaiStagingnetwork.