Seaside issue #785 RESTful URL route caching

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Seaside issue #785 RESTful URL route caching

timrowledge
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.

Does anyone remember anything about this that might help? Is/was there an expectation that deployed systems would have the routes cached before deployment? Any code that I haven't found that is meant for setting this up?

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
We can rescue a hostage or bankrupt a system. Now, what would you like us to do?


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Seaside issue #785 RESTful URL route caching

Philippe Marschall
On Tue, Oct 22, 2019 at 6:05 AM tim Rowledge <[hidden email]> 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
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Seaside issue #785 RESTful URL route caching

timrowledge
Thanks - that sounds perfectly workable. I was made a little nervous by the lack of even cursory ways to set a 'shouldCache' value; always makes it seem like an unfinished idea that may not be reliable!

> On 2019-10-22, at 3:43 AM, Philippe Marschall <[hidden email]> wrote:
>
> On Tue, Oct 22, 2019 at 6:05 AM tim Rowledge <[hidden email]> 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.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Visne saltare? Viam Latam Fungosam scio = Do you want to dance? I know the Funky Broadway.


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev