Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

2,228,303 profile views

nashtu3000's Achievements


Newbie (1/14)



  1. I'd also like an update. Maybe a community share on this that could help hundreds of shop owners?
  2. It seems that those that successfully setup Prestashop to work with Varnish aren't willing to share. I've been searching for this subject for a year now..
  3. I've searched for this for a few hours and it seems it hasn't been implemented even though a lot of people are asking for it. If someone has some more useful input please don't be shy and share a solution!
  4. I second this request, a lot of users are asking for it, does anyone have any input?
  5. Please let me know if you have any Varnish config that's compatible with PS, i've been trying for a week without much success...
  6. Yes that is true, tried it but haven't had that much success with getting the cart working. Anyone else want to contribute to this? It would be an awesome resource for the community.
  7. No, unfortunately i haven't.. Cart adding doesn't work because of this (cookie problems). Looking forward for any valuable input.
  8. Here is what i have so far: /*- * Copyright (c) 2006 Verdens Gang AS * Copyright (c) 2006-2011 Varnish Software AS * All rights reserved. * * Author: Poul-Henning Kamp <[email protected]> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The default VCL code. * * NB! You do NOT need to copy & paste all of these functions into your * own vcl code, if you do not provide a definition of one of these * functions, the compiler will automatically fall back to the default * code from this file. * * This code will be prefixed with a backend declaration built from the * -b argument. */ # Back-End backend default { .host = ""; .port = "8090"; } sub vcl_recv { if (req.http.Accept-Encoding) { if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") { # No point in compressing these #remove req.http.Accept-Encoding; } elsif (req.http.Accept-Encoding ~ "gzip") { set req.http.Accept-Encoding = "gzip"; } elsif (req.http.Accept-Encoding ~ "deflate" && req.http.user-agent !~ "MSIE") { set req.http.Accept-Encoding = "deflate"; } else { # unkown algorithm remove req.http.Accept-Encoding; } } if (req.restarts == 0) { if (req.http.x-forwarded-for) { set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip; } else { set req.http.X-Forwarded-For = client.ip; } } if (req.request != "GET" && req.request != "HEAD" && req.request != "PUT" && req.request != "POST" && req.request != "TRACE" && req.request != "OPTIONS" && req.request != "DELETE") { /* Non-RFC2616 or CONNECT which is weird. */ return (pipe); } if (req.request != "GET" && req.request != "HEAD") { /* We only deal with GET and HEAD by default */ return (pass); } #if (req.http.Cache-Control ~ "no-cache") { # return (pass); #} #Remove has_js and Google Analytics cookies. #set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(__[a-z]+|__utm*|has_js|_chartbeat2)=[^;]*", ""); if (req.url ~ "\/cache\/|\.css|\.js|\.jpg|\.gif|\.png|modules") { unset req.http.Cookie; unset req.http.Accept-Encoding; unset req.http.Vary; return (lookup); } if (req.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf)$") { unset req.http.Cookie; unset req.http.Accept-Encoding; unset req.http.Vary; return (lookup); } if (req.http.Authorization || req.http.Cookie || req.url ~ "admin\-|\.php|token") { /* Not cacheable by default */ return (pass); } # Let's have a little grace if (req.backend.healthy) { set req.grace = 120s; } else { set req.grace = 1h; } return (lookup); } sub vcl_pipe { # Note that only the first request to the backend will have # X-Forwarded-For set. If you use X-Forwarded-For and want to # have it set for all requests, make sure to have: # set bereq.http.connection = "close"; # here. It is not set by default as it might break some broken web # applications, like IIS with NTLM authentication. set bereq.http.connection = "close"; return (pipe); } sub vcl_pass { return (pass); } sub vcl_hash { hash_data(req.url); if (req.http.host) { hash_data(req.http.host); } else { hash_data(server.ip); } return (hash); } sub vcl_hit { if (req.http.Cache-Control ~ "no-cache") { set obj.ttl = 0s; #asta face cache replace la hit care e fortat } return (deliver); } sub vcl_miss { return (fetch); } sub vcl_fetch { #if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == "*") { # /* # * Mark as "Hit-For-Pass" for the next 2 minutes # */ # set beresp.ttl = 120 s; # return (hit_for_pass); #} # unset beresp.http.set-cookie; set beresp.grace = 1h; if (req.url ~ "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)$") { set beresp.ttl = 24h; } else { set beresp.ttl = 5m; } return (deliver); } sub vcl_deliver { /*return (deliver);*/ if(obj.hits > 0) { set resp.http.X-Cache = "HIT"; } else { set resp.http.X-Cache = "MISS"; } remove resp.http.X-Varnish; remove resp.http.Via; #remove resp.http.Age; remove resp.http.Server; remove resp.http.X-Powered-By; return (deliver); } sub vcl_error { // Let's deliver a friendlier error page. // You can customize this as you wish. set obj.http.Content-Type = "text/html; charset=utf-8"; synthetic {" <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>"} + obj.status + " " + obj.response + {"</title> <style type="text/css"> #page {width: 400px; padding: 10px; margin: 20px auto; border: 1px solid black; background-color: #FFF;} p {margin-left:20px;} body {background-color: #DDD; margin: auto;} </style> </head> <body> <div id="page"> <h1>Page Could Not Be Loaded</h1> <p>We're very sorry, but the page could not be loaded properly. This should be fixed very soon, and we apologize for any inconvenience.</p> <hr /> <h4>Debug Info:</h4> <pre>Status: "} + obj.status + {" Response: "} + obj.response + {" XID: "} + req.xid + {"</pre> </div> </body> </html> "}; return(deliver); } sub vcl_init { return (ok); } sub vcl_fini { return (ok); } The problem is that it ain't working with ps_modalcart and i don't know if there other problems as well.
  9. Would you happen to be willing to share you varnish config with the world? I've searched for hours and haven't been able to find anything...
  10. Do you happen to have any varnish config that's working with Prestashop? I've been struggling for 2 days and haven't succeeded in getting it to work correctly..
  11. Another subject that the community would benefit upon yet no-one wants to help with this...
  12. Has anyone succeeded in setting up a Varnish Cache server for Prestashop? Would you be willing to share your config? I'm thinking of doing this and i think a guide and/or possible conf files will be very useful for the community.
  13. Any ideas on accomplishing this? I am also ready to hire someone to do this for me.
  • Create New...