Forums / Suggestions / Better way to check links

Better way to check links

Author Message

Bruce Morrison

Sunday 02 November 2003 9:53:00 pm

Fantastic to see the link checker as part of ezPublish 3.2

The method of checking links is pretty inefficient as entire body of link to be checked is returned (using the fopen).

A better way to handle this is to use the HTTP HEAD method. This tells the server being checked only to return the HTTP headers.

The PEAR HTTP package contains a head function
http://pear.php.net/manual/en/package.http.http.head.php

http://cvs.php.net/co.php/pear/HTTP/HTTP.php?r=1.18

Cheers
Bruce
http://www.designit.com.au/

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Bård Farstad

Monday 03 November 2003 12:17:30 am

Hi Bruce,

thanks for the notice. More efficient methods are welcome.

--bård

Documentation: http://ez.no/doc

Marco Zinn

Monday 03 November 2003 1:37:19 pm

Hi Bard, :)

and please, when someone works on the linkchecker: Don't forget to introduce proxy support or it will be useless for intranet servers.

Marco
http://www.hyperroad-design.com

Paul Borgermans

Monday 03 November 2003 2:03:05 pm

I agree, why not use libcurl for all http outside connections (like for the SOPA module)? It is compatible with the commercial version of ez publish!

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Bruce Morrison

Monday 03 November 2003 2:12:49 pm

I did a quick drop in of the PEAR function and saw considerable speed improvements. Quite important when you have 700+ links to check!

This function allows you to capture the response code which means that you could automatically replace URLs that return a "301 Moved Permanently". Other response codes could be used have a more informative status attached to each link. i.e. a response of 500 is quite different from not being able to connect to the server at all.

In all cases the "Objects which use this link:" drop-down contained "No Object Available" - Is anyone else seeing this?

Proxy support could be added quite easily if the CURL library is used (if installed).

Cheers
Bruce
http://www.designit.com.au/

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

eZ debug

Timing: Jan 15 2025 09:58:34
Script start
Timing: Jan 15 2025 09:58:34
Module start 'content'
Timing: Jan 15 2025 09:58:35
Module end 'content'
Timing: Jan 15 2025 09:58:35
Script end

Main resources:

Total runtime1.2626 sec
Peak memory usage6,144.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0096 685.2656214.7969
Module start 'content' 0.00971.0533 900.06251,934.9844
Module end 'content' 1.06290.1996 2,835.0469637.2969
Script end 1.2625  3,472.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00740.5872210.0004
Check MTime0.00160.1279210.0001
Mysql Total
Database connection0.00090.072810.0009
Mysqli_queries1.160091.86831970.0059
Looping result0.00180.14191940.0000
Template Total1.211796.020.6058
Template load0.00420.336020.0021
Template processing1.207495.627920.6037
Template load and register function0.00100.079710.0010
states
state_id_array0.00260.208510.0026
state_identifier_array0.00240.189820.0012
Override
Cache load0.00380.3041350.0001
Sytem overhead
Fetch class attribute can translate value0.00120.096150.0002
Fetch class attribute name0.00190.149990.0002
XML
Image XML parsing0.00390.312550.0008
class_abstraction
Instantiating content class attribute0.00000.0012100.0000
General
dbfile0.00330.2581410.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs