Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I have the requirement that I need to map the start of (what is effectively) PATH_INFO to an int (PK on some table). I had a look at Apache RewriteMap and chose to go down that route. I'm not sure what go-faster techniques are valid in this environment, or whether they would have any impact (e.g. memoize). Using files to lookup the values, RewriteMap only handles simple string comparisons, which does not cater for my need. These are my test URLs:This is my mapfile: Consider using the following mapping:
Because Apache uses a simple text match, the '/'s (slashes) in the URLs break the mapping. Which led me to use a program. Apache Config: RewriteMap mapping prg:/my/dir/mapper.plmapper.pl:
As this script is going to be hit so many times by the webserver, I wondered if anyone had ideas on speeding it up? -=( Graq )=- In reply to Speeding up Apache RewriteMap script. by graq
|
|