0
I’m making a parser
complete of a website, to change all the hrefs
and src
, is part of a system that I am developing, today I went to the home of a friend who has the internet of 1Mega only, here where I live the speed of the internet is something critical, and the system will run more around here, so I worried because it took a long time to open the site with the parser
, used many str_replace
, tried to use the DOM
but I don’t think it would be viable for an entire website.
The Server that the script is running is a simple dedicated, it has the ping a little high for being abroad and using https, would the server have something to do with the slowness? Someone would advise me to use another method to replace the site links?
The speed of the internet will not affect the processing at all. The only thing it would affect is if you are moving data unnecessarily.
– Maniero
But here at home my connection is 3 megas, and the ping is smaller, and opens almost 5 times faster.
– Cassiano José
I believe there are two possible causes: 1) Very heavy content for 1MB internet; 2) Your methods are causing slowness in the process.
– Papa Charlie
What I used most was
str_replace
, tried theDOM
, but it was many different links and ended up getting heavier with theDOM
.– Cassiano José
Do
parser
naturally it is slow, but you have to identify the cause first! It is no use to think that the fault is thestr_replace
and upload 10MB images... Do a debug, and see in the browser console what is loading.– Papa Charlie
I’ll do it @Papacharlie
– Cassiano José
So the problem is the volume of data, if you are sending unnecessary data, stop doing this. This has nothing to do with processing. If you are sending only the necessary, there is nothing you can do to resolve this problem. If the problem is parsing the speed of the connection will not affect anything. Make it faster just make it wait longer than it already is.
– Maniero
It’s hard to answer without seeing what you’re doing.
– Daniel Omine