[Seaside-dev] Seaside issue #785 RESTful URL route caching

Philippe Marschall philippe.marschall at gmail.com
Tue Oct 22 10:43:59 UTC 2019


On Tue, Oct 22, 2019 at 6:05 AM tim Rowledge <tim at rowledge.org> wrote:
>
> I just stumbled across a fun problem that I hope someone can help me work around.
> When using RESTful stuff (Seaside on VW 8.3 or thereabouts) with an image set to be headless and no-sources I hit a curious place where scanning for the route(s) involves parsing the sources (that I don't have connected) in order to find argument names. There is also an apparent option to cache the routes - presumably meaning that at some development stage  I should be able to pickle the list of possible url to method mappings. However, it doesn't appear to be supported by any means other than editing the #shouldCacheRoutes method which seems to me to be an indication that this is not very supported.

You're supposed to override the method in your filter class. The
methods initial purpose was to avoid the performance hit of doing an
introspection on every web request as this may involve decompilation
or parsing to get the method names. You could use this for our problem
it you initialize a filter with sources present and then save the
image.
You can use positional syntax like this {1} to avoid having to access
the parameter names. See also [1].

 [1] https://github.com/SeasideSt/Seaside/issues/852

Cheers
Philippe


More information about the seaside-dev mailing list