[ Pobierz całość w formacie PDF ]
.Change this to 8000.(don't worry, a typical Plone object is not that big, so even on lower-endcomputers with little RAM this should work well)f& Press the Change buttonNow, for the record there has been a lot of inconsistency in the usefulness of this field through thedifferent areas of Zope, and according to Shane Hathaway, it might not work on all versions of Zope.On a modestly-powered 400MHz laptop, it made a world of difference and Plone feels much fasterand snappier.Caching slotsCredit: Alan RunyanRecently some tweaks to RAM Cache Manager on plone.org and people who have good connectionssaid the speed-up was significant.This is a good overview of the ideas behind caching inZope/CMF/Plone, caveats and how we did it on plone.org to increase performance significantly.Whilst this is not the only approach, it does provide 60 Chapter 1: IntroductionNote: If you are unfamiliar slots, this are covered in Chapter 5Plone has "slots" which you can put path expressions to macros in.In the same order of these slots,the expressions are evaluated and the resulting HTML is put on the page.left_slots puts contentin the left column and right_slots puts content in the right column.Very simple.A pathexpression looks something like: here/calendar_slot/macros/calendarBox (this is inthe default Plone setup right_slots).Rendered in a PageTemplate likepython:path(here/calendar_slot/macros/calendarBox) would return the calendarwidget.You can find more about path expressions using the Zope 2.6 book.In the ZMI if you drop down the items to add box you will see near the RAM CacheManager.The RAM Cache Manager is a default Zope tool and more information can be found in theZope Book - putting one of these into your root folder will enable templates to register with it sothere content is cached.You can have different REQUEST variables as keys into the cached content.So for instance on plone.org we created a cache_calendar RAM Cache Manager and its REQUESTvariables are:f& monthf& yearf& HTTP_ACCEPT_LANGUAGESo each time the calendar_slot is rendered it checks the REQUEST for these variables and matchesthem to the output of the expression.This allows us to have the calendar cached in multiple langaugesand with different year/month settings.This is quite nice.right? The cache manager keeps the baked HTML and when your object/templatechanges it invalidates the cache (or you can manually/programmatically invalidate it).But there aresome problems.Things could never be this easy, right?Firstly you can not cache macros.So having calls likehere/calendar_slot/macros/calendarBox will never be picked up by the cachemanager.So you have to be explicit like here/calendar_slot.Butportal_skins/plone_templates/ui_slots/calendar_slot is a well formed HTMLdocument! You can't just include that rendered.So you must customize this template so that only thediv shows.Then you must go to the Properties tab of your Plone Root (what contains portal_skins andother tools) and change the path expression to here/calendar_slot.Make a few requests andlook at the statistics of RAM Cache and you will see the Hits.And when you take out the tagsand other stuff (because we dont want that to come with the template when you render it) your PloneHTML will still be well formed.Secondly here/calendar_slot caches the template in the context of the object, this is whereAcquisition will bite you.If you render the path expression here/calendar_slot in plone.org you getthe calendar_slot rendered in the context of /, but if you are looking at sayhttp://plone.org/Members/runyaga/ then you will get the calendar_slot rendered in the content of/Members/runyaga which is a different entry.So what we want is not to say tal:replace="here/calendar_slot" but we want to say inthe Properties tab for left_slots, portal/calendar_slot.And portal should be defined inplone_templates/main_template as global portalhere/portal_url/getPortalObject; and then you will always render the calendar_slot inthe context of /.Whilst this is not the only approach, it does provide 61 Chapter 1: IntroductionThen for the specific setup we have on plone.org.The navtree:- cache_navtree- AUTHENTICATED_USER- HTTP_ACCEPT_LANGUAGE- URL1If you cache here/navigation_tree_slot you should only get entries by URL1 in the currentlySELECTED Language of the Logged in User.Anonymous is the user for people not logged in.The News box:- cache_news- HTTP_ACCEPT_LANGUAGEWe only need to cache the portal/news_slot by languages just so that the i18n labels are cached.Caching PagesCache Managers for PlonePlone comes with two Cache Managers:f& HTTP Accelerated Cache Manager works by adding HTTP Cache headers to objects.f& RAM Cache Manager caches objects in RAM for fast retrieval.Both these caches are discussed further in the Zope Book section on cachingCaching 404 Error PagesCredit: Geoff DavisWhile setting up a client machine running Windows NT, I noticed a large number of 404 errors in thelog.It turns out the client machine was getting a lot of probes for backdoors left by various worms [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • higrostat.htw.pl
  •