Jump to content

TUniImagen - Property Picture and URL


Javi

Recommended Posts

Hi Farshad

 

I have several questions about TUniImagen component. For the properties: "Picture" and "URL"

What is the difference between property "Picture" and "URL"?

What property consumes less resources?

What property loading in the web browser before?

What happens when both properties are used: Picture with a picture and apuntanto URL to an image?

 

All this is because I have a frame with more than 50 images the same and want to optimize the load.

 

Thank you very much.

Javi

---------------------------------------

 

Hola Farshad

 

Yo tengo varias preguntas sobre el componente TUniImagen. Sobre las propiedades: "Picture" y "URL"

¿Qué diferencia hay entre la propiedad "Picture" y "URL"?

¿Qué propiedad consume menos recursos?

¿Qué propiedad carga antes en el navegador web?

¿Qué pasa cuando ambas propiedades estan usadas: Picture con una imagen y URL apuntanto a una imagen?

 

Todo esto viene, porqué tengo un marco con más de 50 imágenes iguales y quiero optimizar la carga.

 

Muchas gracias.

Javi

Link to comment
Share on other sites

  • 4 weeks later...

First of all, I was wrong in the original post.

 

All this is because I have a frame with more than 50 images the same and want to optimize the load.

 

It should have been:

 

All this is because I have TEN frames over 50 images the same and want to optimize the load.

 

A total of 500 images equal.

 

 

I've done some research and have come to the following conclusions.

 

 

If we have a "TUniImage", there are three combinations to load an image:

 

1 °. "TUniImage.Picture" with "Escudo.png"

2 °. "TUniImage.Picture" not image. And "TUniImage.Url" = "files/Escudo.png"

3 °. "TUniImage.Picture" with "Escudo.png" and "TUniImage.Url" = "files/Escudo.png"

 

 

>>> 1 °. "TUniImage.Picture" with "Escudo.png" >>>>>

 

1. Server calculates a hash of "Escudo.png".

2. Server creates a copy of "Escudo.png" in "/cache/MyProyect/ __XXXXXX.png"

 

Thus, all pictures "Escudo.png" to be used in the project, point to the same image, as it has the same hash (/cache/MyProyect/ __XXXXXX.png).

 

Advantage: If you have 100 images "Escudo.png", the client will only download the image once.

Disadvantage: If we have 100 images "Escudo.png", the server must calculate the hash of all, for each session.

 

Example:

<img width="201" height="62" src="/MyProyect.dll/cache/MyProyect/__1890BDDC7929BD1F91BA9E88.png" hspace="0" vspace="0"> </ div>

 

 

>>> 2 °. "TUniImage.Picture" not image. And "TUniImage.Url" = "files / Escudo.png" >>>>>

 

Advantage: If you have 100 images "Escudo.png", the client will only download the image once. The server does not calculate the hash "Escudo.png".

Disadvantage: At design time, "Escudo.png" can not be viewed.

 

Example:

<img src="files/Escudo.png" hspace="0" vspace="0">

 

Bug detected. The size of "TUniImage", indicated at design time, not saved (missing: width="201" height="62").

 

 

>>> 3 °. "TUniImage.Picture" with "Escudo.png" and "TUniImage.Url" = "files/Escudo.png" >>>>>

 

1. Server calculates a hash of "Escudo.png".

2. Server creates a copy of "Escudo.png" in "/cache/MyProyect/ __XXXXXX.png"

3. The client is downloaded "files/Escudo.png"

 

I think there would not have to calculate the hash of "Escudo.png" is not used. This way we would have all the above advantages. And I think, no inconvenient.

 

 

I hope you understand.

 

Farshad, can confirm my observations.

 

Thank you very much.

Javi

---------------------------------------

 

Antes de nada, me equivoque en el post original.

 

Todo esto viene, porqué tengo un marco con más de 50 imágenes iguales y quiero optimizar la carga.

 

Tendría que haber sido:

 

Todo esto viene, porqué tengo DIEZ marcos con más de 50 imágenes iguales y quiero optimizar la carga.

Hacen un total de 500 imagenes iguales.

 

 

Yo he investigado un poco y he llegado a las siguientes conclusiones.

 

 

Si nosotros tenemos un "TUniImage", hay tres combinaciones para cargar una imagen:

 

1º. "TUniImage.Picture" con "Escudo.png"

2º. "TUniImage.Picture" sin imagen y "TUniImage.Url" = "files/Escudo.png"

3º. "TUniImage.Picture" con "Escudo.png" y "TUniImage.Url" = "files/Escudo.png"

 

 

>>> 1º. "TUniImage.Picture" con "Escudo.png" >>>>>

 

1. Server calcula un hash de "Escudo.png".

2. Server crea una copia de "Escudo.png" en "/cache/MyProyect/__XXXXXX.png"

 

 

De esta forma, todas las imagenes "Escudo.png" que se usen en el proyecto, apuntaran a la misma imagen, ya que tiene el mismo hash /cache/MyProyect/ __XXXXXX.png)

 

Ventaja: Si tenemos 100 imagenes "Escudo.png", el cliente solo descargara una vez la imagen.

Desventaja: Si tenemos 100 imagenes "Escudo.png", el servidor, debe de calcular el hash de todas ellas, por cada sesión.

 

Ejemplo:

<img width="201" height="62" src="/MyProyect.dll/cache/MyProyect/__1890BDDC7929BD1F91BA9E88.png" hspace="0" vspace="0"> </ div>

 

 

>>> 2º. "TUniImage.Picture" sin imagen y "TUniImage.Url" = "files/Escudo.png" >>>>>

 

Ventaja: Si tenemos 100 imagenes "Escudo.png", el cliente solo descargara una vez la imagen. El Servidor no calcula el Hash de "Escudo.png".

Desventaja: En tiempo de diseño, "Escudo.png" no se puede ver.

 

Ejemplo:

<img src="files/Escudo.png" hspace="0" vspace="0">

 

Bug detectado. El tamaño de "TUniImage", indicado en tiempo de diseño, no se guarda (falta: width="201" height="62").

 

 

>>> 3º. "TUniImage.Picture" con "Escudo.png" y "TUniImage.Url" = "files/Escudo.png" >>>>>

 

1. Server calcula un hash de "Escudo.png".

2. Server crea una copia de "Escudo.png" en "/cache/MyProyect/__XXXXXX.png"

3. El cliente se descarga "files/Escudo.png"

 

Yo creo que no habría que calcular el hash de "Escudo.png", no se usa. De esta forma tendriamos todas las ventajas anteriores. Y creo que, ningún inconveniente.

 

 

Espero que se entienda.

 

Farshad puedes confirmar mis observaciones.

 

Muchas gracias.

Javi

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...