18
Squiz Question Time!

Squiz IUC 2010 - 3.4 Open Discussion

  • Upload
    squiz

  • View
    2.321

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Squiz IUC 2010 - 3.4 Open Discussion

Squiz Question Time!

Page 2: Squiz IUC 2010 - 3.4 Open Discussion
Page 3: Squiz IUC 2010 - 3.4 Open Discussion

Page 1 Bodycopy:<script type="text/javascript"> $(document).ready(function(){ pageTracker._trackPageview('/myform/page1'); });</script>

Thankyou Bodycopy:<script type="text/javascript"> $(document).ready(function(){ pageTracker._trackPageview('/myform/submit'); });</script>

@joel_a_smith:

Page 4: Squiz IUC 2010 - 3.4 Open Discussion
Page 5: Squiz IUC 2010 - 3.4 Open Discussion

Caching and Matrix

A crash course (not for the faint hearted)

Page 6: Squiz IUC 2010 - 3.4 Open Discussion

A Common Server/Proxy/Internet architecture

Matrix Caching

Squid/Proxy Caching

Squid/Proxy Caching

Browser Caching

Page 7: Squiz IUC 2010 - 3.4 Open Discussion

Matrix Cache

Avoids Matrix having to regenerate page contents each hitConfigured by Matrix Cache setting in Cache Manager and Header settings in System Configuration

Squid/Proxy Cache (Reverse Proxy)

Prevents hits reaching MatrixConfigured by browser cache setting in Cache Manager (and proxy settings)

Squid/Proxy Cache

Prevents requests travelling via the InternetConfigured by browser cache setting in Cache Manager (and proxy settings)

Browser Cache

Prevents requests being sent by the browserConfigured by browser cache setting in Cache Manager (and browser settings)

Page 8: Squiz IUC 2010 - 3.4 Open Discussion
Page 9: Squiz IUC 2010 - 3.4 Open Discussion

Pulling apart the RSS QuestionWhere are the points of caching?

The RSS Data Source asset itselfThe asset listing formatting the information from the feed

The page nesting the asset listing for display to the public (?)

What are the complications?

Asset updated trigger event not suitable for RSS feeds

Page 10: Squiz IUC 2010 - 3.4 Open Discussion

Pulling apart the RSS QuestionWhat tools do we have at our disposal?

Default Cache Settings in Cache managerType-specific Cache Settings in Cache managerAsset-specific Cache Settings in Cache manager Clear Matrix cache trigger actionClear Squid cache trigger action Clear Matrix cache toolClear Squid cache tool

Page 11: Squiz IUC 2010 - 3.4 Open Discussion

Defining our constraintsWhat delay can we tolerate?

This is a business decision and must be made in line with policies and agreements

How much load can our server handle?

This is a technical decision and must take into account traffic, page generation complexity, and server specs

How long does it take to collect the RSS feed?

This will influence how frequently we try to refresh the feed

Page 12: Squiz IUC 2010 - 3.4 Open Discussion

4 Options

Disable Caching altogether

Modify Caching settings for all assets involved in feed delivery

Use JavaScript magic to populate a html div after page load

Use an external script to monitor the RSS feed and send clear cache requests

Page 13: Squiz IUC 2010 - 3.4 Open Discussion

Modifying the caching for appropriate assets Assumptions:

The RSS feed is only ever called by a particular asset listing

The asset listing is not nested in another page (if it is, we'll also need to modify the caching time for that page)

2 minute update time is decided to be acceptable

The server hardware can sustain the additional load involved in retrieving the rss feed and regenerating the asset listing every 2 minutes, above the standard load

Page 14: Squiz IUC 2010 - 3.4 Open Discussion

Modifying the caching for appropriate assets

Use the Root Node Specific cache settings to set the default cache time for the RSS Data Source asset to <2mins

Use the Root Node Specific cache settings to set the default and browser cache time for the Asset Listing page to 2 minutes (120s)

Page 15: Squiz IUC 2010 - 3.4 Open Discussion

Using JavaScript magic

Assumption - the asset listing is nested in another page and is never called directly (Asset listing does not have a webpath? Type 2 linked?)Assumption - 2 minutes time to update is acceptable

Set cache expiry times as per previous example Add JavaScript onLoad to populate the appropriate div using the content of the asset listing

Page 16: Squiz IUC 2010 - 3.4 Open Discussion

Using an external script

Script must do the following:

Collect the RSS feed content, compare it with a saved copyIf the copy is different (or does not exist) replace the saved copy and:

Send _recache requests for the appropriate assets (clears the Matrix cache)Send requests for the appropriate content with http headers:

Pragma: no-cacheCache-Control: no-cache (clears the Squid/Proxy cache)

Page 17: Squiz IUC 2010 - 3.4 Open Discussion
Page 18: Squiz IUC 2010 - 3.4 Open Discussion

(See attached WCAG2 Presentation)