Removed bogus and buggy Memcached reference from html/pages/ports.inc.php to avoid duplicates.
This code was without function. It didnt relief the SQL from any additional queries and only adds duplications in case memcached is used.
Removed bogus and buggy Memcached reference from html/pages/ports.inc…
….php to avoid duplicates.
I don't use memcache myself but is this not more a case that the code is just wrong rather it needs removing?
I thought long about this and the only real way to make use of the memcache here is to replace the * SQL-Query above with and port_id query and then make N (where N=total amount of ports) succeeding queries to the SQL if the memcache does not hold any data.
This will cause a terrible SQL performance because on big installs it will lead to thousands of 1-row queries that penetrate the SQL and thus drain excessive resources on the SQL-host.
An alternative would be to prefer Memcache over SQL but this may cause incomplete port-listings in case the Memcache goes Out-Of-Memory and purges out old entries.
Having a count(*) operation on the SQL and check it against the Memcache's objects is a possible solution to avoid this issue, however it may cause an additional issue when pulling the missing ports from the SQL as the Query designated for it will include N (where N=total amount of ports known to memcache) WHERE statements. This may exceed maximum Query-length on the SQL.