GithubHelp home page GithubHelp logo

experimental.xslnavtree's Introduction

Introduction

The dynamic parts of most Plone pages are:

  • Breadcrumbs
  • Navigation tree
  • Collection portlets.

Moving these page fragments to Edge Side Includes would allow caching of the page indefinitely in a caching proxy.

In this experiment I demonstrate how XSLT can generate a navtree for a large site very quickly.

Generating a navtree

Create some test data (100,000 entries):

$ python testdata.py > navtree.xml

Execute navtree queries with timing:

$ xsltproc --timing navtree.xsl navtree.xml > navtree.html Parsing stylesheet navtree.xsl took 0 ms Parsing document navtree.xml took 12657 ms Applying stylesheet took 37 ms Saving result took 0 ms

Points to consider

  • The test data is a 17M file, so parsing takes a long time (12s when not in the FS cache, 1s when FS cached.) Clearly this can't be done on every request so a custom python based server would be used instead of Apache or Nginx XSLT modules.
  • The navigation portlet may not always be rendered, for instance when there is no content for it to display. This may lead to a whole portal column being hidden. If the tree is generated in an ESI then we cannot know at page rendering time whether the navigation portlet should be displayed or not. This could possibly be fixed up with Javascript.
  • The site structure data in navtree.xml should be updated whenever the portal_catalog changes. Parsing is so slow that content editors may not see their changes immediately reflected in the navigation tree. Parsing could be speeded up by partitioning the data (e.g. per site section) though this would require additional bookkeeping by the portal_catalog. It might be sufficient just to ensure that the current item's title is taken from the page which contains the ESI include, passing it in the ESI querystring.
  • No security filtering is performed yet, though it should be possible and relatively quick. Logged in users could have their roles and groups stored in the data section of the auth tkt cookie, making it available to the navtree renderer.

experimental.xslnavtree's People

Contributors

lrowe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.