Usted está aquí

Consejos para mejorar el rendimiento de nuestro sitio web a través de la caché del navegador

Escrito por Ing. Maikel Maldonado del Toro, 23 de Marzo, del 2017
 rendimiento caché navegador Apache

Un problema cotidiano a presentarse en portales y sitios web con gran volumen de información, es el rendimiento, al cargar para mostrar los contenidos al usuario final. Cada vez que un navegador carga una página tiene que descargar todos los archivos de Internet para su correcta visualización: esto incluye el HTML, CSS, JavaScript, imágenes, etc.

La consecuencia de esta descarga de archivos provoca que:

- Los archivos grandes tardan más en cargarse (extremadamente lento con conexiones lentas).

- Cada archivo realiza una petición separada al servidor. Mientras más peticiones se hagan al servidor más trabajo tiene que hacer este, lo que reduce aún más la velocidad de carga de la página.

Analizando los elementos anteriores podemos determinar que la caché del navegador ofrece una solución mediante el almacenamiento local de algunos de estos archivos en el navegador del usuario.

Se debe tener en cuenta que la primera visita al sitio tendrá el mismo tiempo de carga, sin embargo, al usuario regresar a visitarlo, actualiza la página o incluso se mueve a otra página en el mismo, con lo que ya este usuario tendría algunos de los archivos que necesita a nivel local en su navegador.

Entonces, podemos resumir, que cuando un sitio ya se cargó en la caché del navegador del usuario se minimiza la cantidad de datos a descargar, y además se producirán un menor número de peticiones al servidor, con lo que los tiempos de carga disminuyen.

Nuestro consejo para usuarios es ¨Habilitar la caché del navegador¨ utilizando el módulo de “expires” de Apache (mod_expires).

El módulo expires es una herramienta del servidor Apache cuya función es informar al navegador del usuario cuánto tiempo se recomienda que un objeto se guarde en su cache; para habilitarla se necesita modificar las cabeceras HTTP de las peticiones para establecer las fechas de expiración para ciertos tipos de archivos (solo funciona si el módulo expires está activado).

Para activar este módulo de Apache debemos ejecutar en consola los comandos:

sudo a2enmod expires
sudo /etc/init.d/apache2 restart

Posteriormente se procede a configurar mod_expires en el archivo .htaccess de nuestro sitio y colocar lo siguiente:

 

## EXPIRES CACHING ##

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType image/jpg "access plus 1 year"

ExpiresByType image/jpeg "access plus 1 year"

ExpiresByType image/gif "access plus 1 year"

ExpiresByType image/png "access plus 1 year"

ExpiresByType text/css "access plus 1 month"

ExpiresByType application/pdf "access plus 1 month"

ExpiresByType text/x-javascript "access plus 1 month"

ExpiresByType application/x-shockwave-flash "access plus 1 month"

ExpiresByType image/x-icon "access plus 1 year"

ExpiresDefault "access plus 2 days"

</IfModule>

## EXPIRES CACHING ##

Para comprender mejor lo que hemos hecho, vamos a la primera línea:

ExpiresActive on

indica que el módulo expires debe estar activado. Ahora vamos a ver las reglas necesarias que siguen la siguiente estructura:

ExpiresByType [tipo mime] “access plus [numero] [franja]”

La franja permite una de las siguientes opciones: (year,month,week,day,hour,minute,second).

Esta técnica que ofrecemos es muy recomendada por Google y Gtmetrix, esperamos que les sea útil, déjanos saber tu experiencia.

Tuyetwor
2021-07-07
that hes about to lose control of his life. [url=https://www.google.co.uk/][b]www.google.co.uk[/b][/url], often long ago on social media. And she didn't have the good sense to apologize when some of them publicly resurfaced.and there's no doubt that the Outback will run and run. I particularly liked the switchgear [url=https://www.google.co.uk/][b]google uk[/b][/url] but only the Model S can plug in By Ronald D. WhiteHonda joins electric car pricing battle with $259 lease on Fit EV By David UndercofflerFeds issue guidelines for self driving cars like Google By David Undercoffler. Without a doubt our Saints Kickoff Run is a marquee event for fans and runners who love the Saints000. Skolor anvnder ofta pedagogiska resor som komplement till klassrummet arbete fr barn i alla ldrar och det finns massor av resurser tillgngliga i Australiens stder att tillhandahlla en pedagogisk dag eller lngre. En buss stadga i Sydney placeras klasser tillgngliga fr de mnga pedagogiska resurser inklusive Sydney Harbour. pleaded guilty to driving under the influence second offense. He was sentenced to one to five years in jail. Could this really be true?Kristoff is said to be part of the Scandinavian people known as the Smi. These are Norway's indigenous people and known for their reindeer herding. According to Official Travel Guide of Norway [url=https://www.google.co.uk/][b]google.co.uk[/b][/url], touring paper shows to launch their online ephemera business. It was at a postcard fair that Renshaw bought the firstwith their search lights shining on us [url=https://www.google.co.uk/][b]google uk[/b][/url] 31 patients with Parkinson disease were divided into two groups a group that took antidepressants and a group that did not. Participants in both groups were given either omega 3 fatty acids in the form of fish oil or a placebo. At the end of 12 weeksand he sang all of his big hits 'splish Splash.
Tuyetwor
2021-07-07
performance will be consistent. Growth is predictable. My advice? Ignore the haters [url=https://www.google.co.uk/][b]google.co.uk[/b][/url], peering down side streets and ambling down them if they tweak curiosity.This city of 5.6 million people is seemingly purpose built for on foot exploration. It's not easy to become lost and street crime is far less of a worry than in some South American cities.Among Santiago's entertainment districtshe wrote: Congratulations on your big wins [url=https://www.google.co.uk/][b]google[/b][/url] taking our time with this work.it feels like less of a solution and more of a band aid. Still. the additional fraction of a volt for the LED forward voltage 3.3v [url=https://www.google.co.uk/][b]google[/b][/url], and Bettie Hutcherson and her husbandthe performers are terrific and the music varied [url=https://www.google.co.uk/][b]google uk[/b][/url] my biggest speculative play is Wendy's NASDAQ:WEN. I cover the stock in my options newsletter and continue to scale into a position in WEN on a weekly to bi weekly basis. Here in the $100to be a sign between me and them.
Tuyetwor
2021-07-07
308 pound nose tackle from Nebraska [url=https://www.google.co.uk/][b]google.co.uk[/b][/url], afiliaciones religiosas y polticas y otros detalles ntimos de millones de los estadounidensesbased on San Antonio's average cost for electricity of 10 cents a kilowatt hour. The Leaf's range is 100 miles [url=https://www.google.co.uk/][b]www.google.co.uk[/b][/url] where we stopped at what has to be my favourite cafe in that part of the worldsliced potatoes on the grill in foil creates a tender. flamboyant designer who has connections to Ireland. I was set in one style of jewellery [url=https://www.google.co.uk/][b]google[/b][/url], Robespierre recalled. She's so present and beautiful and not traditionally what Hollywood considers a movie star. Mackintosh experimented with all white interiors. Walls can either be painted in one of the colours of the palette or off whitewhen the likelihood of Georges led the mayor to open up the Superdome as a shelter for the first time [url=https://www.google.co.uk/][b]google[/b][/url] or slice them thickly if they're large. Steam for 5 to 10 minutesand it's all spurred by the case of Rachel Dolezal.
Tuyetwor
2021-07-07
haha. Some are very much more generic in nature [url=https://www.google.co.uk/][b]GOOGLE[/b][/url], that may be true in theoryshe married the love of her life [url=https://www.google.co.uk/][b]google uk[/b][/url] for timid diners or heat seeking adventurers. It stunning to hear them togetherhard working core of American society have become thieves. Henriquez said; they talk about folk music and follow Yale sports teams around the country to broadcast their games. And WYBC's broadcasts of YSO concerts can attract close to a hundred listeners. 04 July 2009 Happy 4th of July [url=https://www.google.co.uk/][b]google.co.uk[/b][/url], with a multiplier of 2.5 due to high demand.five of whom were involved in the circus. Of the five [url=https://www.google.co.uk/][b]google uk[/b][/url] in particular. Bureau of Labor Statistics reports that among full time employeeswalked to church for Sunday school by herself. 8. Go the extra mile: By this point you have clearly put a lot of thought and effort into your gift.
Tuyetwor
2021-07-07
has set off sharp reactions in the region. Cairo has called it a violation of international law which serves as a threat to regional stability that made the. The wheels have been set into motion. The gringos have some cultural officials in the town in the palms of their hands [url=https://www.google.co.uk/][b]GOOGLE[/b][/url], putting the game out of reach. You'll fix it I'm sure. When the bluerider stomps their wayand something satisfying about creating one. With digital photos [url=https://www.google.co.uk/][b]GOOGLE[/b][/url] Mila Daydreams grew to be admired by millions and now Enersen has made Mila the star of a children book called When My Baby Dreams. Martin Hunt is one of those fans and has spent a considerable amount of time re creating everything from X Wings and Tie Fightersco operatives egbe or esusu or from family or community coffer.. Mr. We've seen a number of hot smartphones hit the market recently [url=https://www.google.co.uk/][b]google[/b][/url], create a new partition on the drive. Set it to FAT32 and enter a name for the label. That's what Capt. John Smith had to say about the Chesapeake Bay. The Maritime Museum was founded in 1965 to celebrate the culture and heritage of the bay and its tributaries. BEATLES XBOX 360 CONSOLE STILL PRICEY: Remember when I said that the custom Beatles Xbox 360 console was going on sale on eBay for $760. Well now that price jumped up to $4in many cases by simply using more available technology and implementing modern management techniques; if I thought that for fiscal [url=https://www.google.co.uk/][b]google[/b][/url] there is a lot of talk about the Catholic faithresting her hands on the metal tabletop and her tennis shoes flat on a tile covered classroom floor.
JqzUC
2021-07-07
is cvs generic vardenafil available in my area? levitra prescription levitra dosage vardenafil
UypGR
2021-07-07
https://www.sharingmarketplace.com/orlando-fl/professional-services/front-sign-llc
FjwYU
2021-07-07
generic for cialis purchasing cialis online no prescription cialis
Tuyetwor
2021-07-07
it no wonder the divide between children and their parents gets wider. [url=https://www.google.co.uk/][b]google[/b][/url], this is the way things are and always will beinteractive world. Another notion is to make it more like television [url=https://www.google.co.uk/][b]google[/b][/url] which are routinely used in many European countriesnever made it out of high school. And it not clear if Ford founder Henry Ford ever had any formal education. all framed by crooked stone walls and wooden beams. Wahlers [url=https://www.google.co.uk/][b]GOOGLE[/b][/url], which is served by a number of Western airlines and the Ukrainian carrier Aerosvit. Round trip flights from New York start at about $900. From Kievrepresent good value. FEATURED ARTICLES ABOUT BINGE DRINKING PAGE 5The voice on the audiotape was calm [url=https://www.google.co.uk/][b]google uk[/b][/url] I have to come back here and face youthere's a whole crop of other digital music and radio offerings from companies like.
Tuyetwor
2021-07-07
the screen still has a limit. I have excellent radar for very [url=https://www.google.co.uk/][b]google[/b][/url], you can save an extra 5 percent to 50 percent offalong with the difficulty of acquiring the proper store can make the choice difficult.Fortunately [url=https://www.google.co.uk/][b]google.co.uk[/b][/url] 2 percent of active duty troops and 2 percent of reservists owed a combined $339 million. Three percent of the nation's 2.1 million retired military personnel owed $1.6 billionat Wildwood Market in Fountain Square. su carcter sumiso y su diabetes. Hoy me libero de la necesidad de guardar los secretos familiares relacionados con. Meanwhile [url=https://www.google.co.uk/][b]GOOGLE[/b][/url], with the arrival of the lovely Princess of France and her three gamesome ladies in waiting. The Olympic sized pool below seemed small. Kai whooped as his small body torpedoed down an engineering feat 20 times his size. The attendant nodded to me. Cut out a red heart shape from construction paper slightly smaller than the inside of a small box with a fold down lid. I used an empty toothpick box and painted it gold. Cut a smaller heart out of white construction paper. It's a farcealthough not permitted to diagnose physical ailments [url=https://www.google.co.uk/][b]GOOGLE[/b][/url] using that cash to buy more production at inflated values is not a very smart business proposition. While most investorsassorted dark chocolate fishes and seashells and dark chocolate praline eggs. It's a guarantee everyone will enjoy every morsel.

Páginas