Caching and header expires in 1.9

Caching and header expires in 1.9

by james hill -
Number of replies: 2

Hi, I have been trying to implement header expires on my moodle installation. I am still using moodle 1.9. Does anyone have any advice how to do this? It is slowing down my site.

In my .htaccess file I have tried to enable mod_expires but doesn't seem to be working. I am on a shared server and dont have access to the .conf file or shell access.

Thanks for any advice,

James

Average of ratings: -
In reply to james hill

Re: Caching and header expires in 1.9

by james hill -

Does anyone have any advice? Any tricks to leverage browser caching? It is mainly a few big images that are slowing my site down and would be great if users could cache them on first viewing.

James 

In reply to james hill

Re: Caching and header expires in 1.9

by Floyd Saner -

The first thing I would do is reduce the image size and resolution.  Large, high resolution images are of no practical use as headers.  In fact, unless you want users to zoom in on an image, high resolution and large image file size is of no use at all.

It is very possible that you have a large image and have the image display configured to resize the image each time it is displayed. This takes a lot of browser processing time - even if the image is cached.  So, it may not be a cache problem; it is likely an on-the-fly resizing problem.

My advice to anyone using images for display in a browser is: before uploading the image

a) Use a program like Photoshop to resize the image to the size you want in the browser.

b) Compress the image (jpg) to a value that still gives a sharp display (usually 65-75%)

Give that a try and see if it solves your problem.