Storing a request in a saved server resource variable?

Asked

Viewed 41 times

0

Using Wordpress I will need to use the article link more than once, I wonder if storing the 'permalink' in a server resource saving variable, since I will only make a request to the database or there is an expense to process that does not compensate?

Ex:

$post_url = get_permalink();

// To take the URL and store in a variable

echo $post_url;  

// To use it

PS: I will use the link 4 times.

1 answer

2

Without a doubt you will reduce the calls to the bank and to Theloop objects using a variable, and there will be savings in server processing/resource. Although this economy is small, any economy is welcome, especially with a clean code like this (IMO).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.