1、The Art of CachingAccelerating Ibexa sites with Fastly and VarnishVIDAR LANGSEIDVidar LangseidSenior Support Software EngineerIbexaMeWhat is HTTP Cache anywayHTTP Cache refers to an integrated reverse proxy,one you controlTypically,located between the public Internet and the application serverIt cac
2、hes HTTP responses from the backend server(origin)future requests for the same resource can be handled without contacting backend serverIn principle,this would be quite easy if:all pages would look the same for every userpages/content would never change OR they would expire at predictable timesWebBr
3、owserHTTPCacheWebServer(origin)WebBrowserHTTPCacheWebServer(origin)#1#2Supported HTTP cachesSymfony Reverse ProxyEnabled by default in Ibexa DXPFor development purposesVarnishOpensource applicationFastly is a CDN serviceImplementation based on varnishPoP(Point of Presence)all over the worldhttps:/ H
4、TTP caches and their supported featuresSymfony reverse proxyVarnishStale CacheESIFastlyStale cacheESIShielding(https:/ Optimizer(https:/doc.ibexa.co/en/latest/content_management/images/fastly_io/)Configuring Varnish/FastlyVCL Varnish Configuration LanguageVCL files(ez_main.vcl,varnish6.vcl etc.)are
5、organized into subroutines.Naming of the subroutines varies a bit between Varnish and FastlyFeature:Stale Cache Deliver stale(outdated)data until cache has been updated Deliver stale data if origin is unavailableFeature:User context aware(user permission aware)Solution:Get the user context hash(iden
6、tify user based on roles and permissions)Resources:https:/foshttpcachebundle.readthedocs.io/en/latest/features/user-context.html#how-it-workshttps:/doc.ibexa.co/en/latest/infrastructure_and_maintenance/cache/http_cache/context_aware_cache/#context-aware-http-cacheBrowserHTTP-CacheOriginGET /Response