ROUTING :: /route/to/whatever-seo-keywords_@ID@/

65 views
Skip to first unread message

Emmanuel Simond

unread,
Mar 15, 2018, 9:15:38 AM3/15/18
to Fat-Free Framework
Hi all

Starting a new project served by the new F3!

1st Setting up a good ROUTING : 

How to instruct F3 to handle routes by extracting the *ID* present at the end of the URL

/route/to/whatever-seo-keywords_ID/

Ok named route to the rescue:

 wildcard tokens in the route : e.g.
 GET @complex:/route/whatever-seo-keywords_@ID

becomes

 GET @complex:/route/*_@ID

using a numeric index to specify value, for instance:{{'complex','1=we-dont-use-it,2=@ID'|alias}}


or  Apache mod_rewrite / nginx / Lighttpd rewrite-once 


Thanks for your help and your time
Emmanuel




ikkez

unread,
Mar 15, 2018, 12:18:38 PM3/15/18
to Fat-Free Framework
You could do it like you've described, but why not simply

 GET @complex:/route/@ID/whatever-seo-keywords

?

You could also encapsulate it like this:

 GET @complex:/route/{@keywords}_{@ID}

Emmanuel

unread,
Apr 2, 2018, 8:43:33 AM4/2/18
to Fat-Free Framework
@ikkez 

Yallo Christian

your right approach  too complicated  
better to bypass F3router

you now the portal get up to 100 users "at the same time" (they say concurrent right?  thus they don even knmos each oter right?)

so 100 hits X 36 HTTP requests for home page (yes many photos on the lanpage)
& 100 hits X 6 request for cached "details pages"

hence better to bypass either !nginx!Apache!!banshee!&co! 

and  option 1. use only  1 router

How to now welche|wich?)  is the quepard solution?

P.P.S.

right, most hits will hit the cache,.  Fortunately , no regexp here for the mass traffci 

ikkez

unread,
Apr 3, 2018, 9:47:44 AM4/3/18
to Fat-Free Framework
as far as i know, images are not even handled by php in nginx.. it serves them directly and does not even boot up the php-fpm module.. for apache it's somewhat the same, as the .htaccess will serve existing files directly.. only non-existing files/dirs (routes) are catched by the rewrite rule and send to index.php, which the loads F3.
What are your concerns in general? you have performance issues already?
Reply all
Reply to author
Forward
0 new messages