Caching images only

Kumar Shantanu shantanu at techblue.co.uk
Mon Nov 4 14:04:22 CET 2013


Hi, I used this as suggested by you , it's still not caching these images

Varnish logs
>    11 TxHeader     c Content-Type: image/jpeg;charset=UTF-8
>    11 TxHeader     c X-Cache: MISS
>    13 TxURL        b 
> /web/demo/home?p_p_id=propertyslider_WAR_propertysliderportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_propertyslider_WAR_propertysliderportlet_img-name=168.jpg&_propert
>    13 TxProtocol   b HTTP/1.1
>    11 RxURL        c 
> /web/demo/home?p_p_id=propertyslider_WAR_propertysliderportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_propertyslider_WAR_propertysliderportlet_img-name=168.jpg&_propert
>    11 ObjHeader    c Content-Type: image/jpeg;charset=UTF-8
>    11 TxHeader     c X-Cache: MISS

Thanks
Shantanu


On 11/04/2013 05:53 PM, Γιάννης Καραγιαννίδης wrote:
> Hi,
> You could always use
>
> // remove cookie from these
> if (req.http.Content-Type ~ "(image|audio|video|pdf|flash|text)") { remove req.http.Cookie; }
>
> Regards
>
> From: varnish-misc-bounces+gkaragiannidis=dolnet.gr at varnish-cache.org [mailto:varnish-misc-bounces+gkaragiannidis=dolnet.gr at varnish-cache.org] On Behalf Of Kumar Shantanu
> Sent: Monday, November 04, 2013 12:19 PM
> To: varnish-misc at varnish-cache.org
> Subject: Caching images only
>
> Hello everybody,
>
> I am trying to cache all images for my website and it's working fine with simple configuration as given below.
>    
> sub vcl_recv {
>    if (req.url ~ "\.(png|gif|jpg|jpeg|bmp)$"){
>          remove req.http.Cookie;
>     }
>
> It's caching image url which is simply ending with filename.jpeg, but this can't cache if the url is bit complex like this
>
> http://test.demo.co.uk/web/demo/home?p_p_id=propertyslider_WAR_propertysliderportlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_propertyslider_WAR_propertysliderportlet_img-name=152.jpeg&_propertyslider_WAR_propertysliderportlet_img-height=400&_propertyslider_WAR_propertysliderportlet_img-width=960
>
> Any idea on how to achieve this. I tried using reqex to match url but failed :(
>
>
> Thanks
> Shantanu


-- 

KUMAR SHANTANU

Signature

TEAM LEAD - IT

FOR AND ON BEHALF OF:

Technology Blueprint Ltd
23 Clemens Street
Royal Leamington Spa
Warwickshire CV31 2DW

T: 0845 004 7142 (Ext. 5001)
E: shantanu at techblue.co.uk
W: www.technologyblueprint.co.uk www.propco.co.uk

The contents of this email are confidential and may be privileged, and 
are intended only for the use of the person or company named herein. Any 
views or opinions presented are solely those of the author and do not 
necessarily represent those of Technology Blueprint Limited.
If you are not the intended recipient of this email or a person 
responsible for delivering it to the intended recipient, you are hereby 
notified that any distribution, copying or dissemination of the 
information herein is strictly prohibited

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20131104/48e6172d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: redhat.jpg
Type: image/jpeg
Size: 2033 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20131104/48e6172d/attachment-0001.jpg>


More information about the varnish-misc mailing list