Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Varnish Cache For Cs-Cart Rate Topic   * * * * * 1 votes

 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 974 posts

Posted 29 March 2017 - 08:08 AM #41

So do you reset the cache by disable/enable addon?

 

Yes I do but then the notification still pops. 

A small disclaimer I do have to note is that I am using xVarnish and the men of xVarnish currently are helping me get Varnish to work 120% in compliance with the free Varnish addon you guys put up on Github.

This is what Bryon from xVarnish wrote me

 

 

Hi Anthony,

That is good to see that enabling HTTPS succeeded.

The contents of the secret file path also look good. The final byte (0x0a) is a newline character, as I hoped. Earlier versions of xVarnish didn't always include a newline there, which could lead to problems with authenticating to Varnish Cache for purges.

That said, however, I see a separate issue apart from these both in the site error_log file you sent last week. The log is showing that the application is attempting to load its own VCL [1]. I'm not certain what the website's VCL files are comprised of, but this is a problem because loading this this alternative VCL will fully replace the xVarnish VCL configuration used by the overall server. That said, I'm certain whatever VCL the site is loading can be included in the overall xVarnish VCL through alternative means; there are plenty of ways to customize the VCL generated by xVarnish, and this can be done in a way specific to this website or even multiple websites. The difference is just that custom VCL would need to be managed by you (from root SSH) as opposed to being loaded by the third-party script/application on the website.

[1] The error_log shows these Varnish Cache commands failing:
`vcl.load /home/pasioonline/public_html/var/conf/varnish/enabled.vcl`
`vcl.load /home/pasioonline/public_html/var/conf/varnish/disabled.vcl`

Moreover, the `vcl.load` command being sent by the site show as having been received by Varnish Cache properly; this confirms authentication succeeds and the secret file trouble is resolved. Also, I think it's important to note that error_log shows both `vcl.load` commands failing with code "106". The 106 code is returned for a VCL syntax error, which indicates that there's some sort of invalid or incompatible code in the enabled.vcl and disabled.vcl files. (Most likely this is a simple version incompatibility, where the site is written for an older version of Varnish Cache. xVarnish installs Varnish Cache 4.1, but quite a lot of software relies on 3.0.)

To proceed, would it be possible for you to share the contents of these two VCL files from the website:

/home/pasioonline/public_html/var/conf/varnish/enabled.vcl
/home/pasioonline/public_html/var/conf/varnish/disabled.vcl

I'll review the and provide instructions on how to include that in the VCL generated by xVarnish.

It would also help if you could let me know what shopping cart application healthavengers.org uses (possibly CS-Cart?) and the version of the installed Varnish Cache plug-in (possibly this: https://github.com/c...age-cache-addon).

Thank you,

Bryon Elston
xVarnish


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 30 June 2017 - 02:51 PM #42

What exactly is the benefit of implementing this ?

 

Have you every used Hotjar or any other software to capture your user's experience?

 

CS-Cart changes CSS and JS filename everytime we refresh cache. It messes up all these tools because they don't cache CSS files with screen recording. When you try to replace what your users looked at, you only see a messed up screen recording without CSS or JS.

 

I have voiced this concern to imac several times. Even you if don't care people like me who try to give better user experience, This is a big deal for Search Engine crawlers. If you check Apache logs, you will see tons of 404 errors for Google - Bing - Yandex bots trying to access to old CSS files. There is no logic or reason to put timestamp into CSS file but as usual it is what it is with CS-Cart.


Edited by mazter, 30 June 2017 - 03:00 PM.


 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 974 posts

Posted 25 November 2017 - 12:46 AM #43

 

Thanks, I did myself a favor by removing this for our CSS files at least.

 

For anybody who is interested in removing hash from CSS filenames.

 

app/functions/fn.common.php

 

Under fn_merge_styles function, you can remove $hash from filename string.
    //$filename = $prefix . '.' . $hash . '.css';
    $filename = $prefix . '.css';

 

 

 

Well thanks again.. NOT

I was locked out of my own store following your instructions.

 


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 25 November 2017 - 01:35 AM #44

Well thanks again.. NOT

I was locked out of my own store following your instructions.

 

 

Makes no sense. Worst case scenario you would have your website look broken because of CSS filename change. You can revert it back and you will login back in.



 
  • Mongoose
  • Senior Member
  • Members
  • Join Date: 08-Mar 13
  • 974 posts

Posted 26 November 2017 - 12:32 PM #45

Makes no sense. Worst case scenario you would have your website look broken because of CSS filename change. You can revert it back and you will login back in.

 

Not blaming you personally but following your instructions got me not paradise but that is as you said be more of an hard coded issue with the code of CS Cart.

At any rate I do was unpleasantly surprised when I was blocked from the admin panel and the file in question that you suggested to amend

 

app/functions/fn.common.php

 

and remove the $hash item from that piece of code and just reinstating the original line of code did not resolve my issue right away. I had to enable the debug mode in CS Cart config.php and there found the underlying problem and unfortunately i cannot remember what it was but the experience was bad enough not to amend the code in the way you suggested earlier.

 


CS Cart Evangelist - running CS Cart 4.7.4 in three domains


 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 26 November 2017 - 06:12 PM #46

Not blaming you personally but following your instructions got me not paradise but that is as you said be more of an hard coded issue with the code of CS Cart.

At any rate I do was unpleasantly surprised when I was blocked from the admin panel and the file in question that you suggested to amend

 

app/functions/fn.common.php

 

and remove the $hash item from that piece of code and just reinstating the original line of code did not resolve my issue right away. I had to enable the debug mode in CS Cart config.php and there found the underlying problem and unfortunately i cannot remember what it was but the experience was bad enough not to amend the code in the way you suggested earlier.

 

 

I am sorry for the trouble. I used this method until 6 months ago. When I upgraded to 4.6.x I started seeing some of the CSS classes were being affected so I moved back to the default version.

 

$hash is causing all the junk that CS-Cart is adding to the filename. They save that into the DB to keep track of their cache hash under control. It is how CS-Cart keeps track of cache variables but again, it causes lot of issues with search engines, hotjar and other tools like rollbar. They would like to be served from consistent css and javascript file names and we can't do it with CS-Cart.



 
  • mokeshop
  • Senior Member
  • Members
  • Join Date: 27-Jul 12
  • 999 posts

Posted 03 April 2018 - 10:08 PM #47

will the free addon be updated for newer versions ?



 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 476 posts

Posted 04 April 2018 - 05:10 AM #48

what is point of $hash?

 

 

why to use $hash on filename? what is point? I really didn't understand this, can someone explain it?

 

 

I really don't understand this. .js?v=2131231231231231123123

 

 

in that case, cache servers will NOT cache it. I read about this long time ago, use proper filename.

 

They use that to make sure that when you update your store the clients will get a new version of the file (as most browsers cache it.

 

 

will the free addon be updated for newer versions ?

 

They have already updated it, it is on the marketplace for €500,-


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • martfox
  • Member
  • Authorized Reseller
  • Join Date: 15-Jan 10
  • 558 posts

Posted 04 April 2018 - 05:35 AM #49

Question for CS-Cart team: Does the demo site http://demo.cs-cart.com/ use varnish cache and is varnish installed on that server?


CS-Cart with 1 Year FREE Web Hosting | CS-Cart optimized SSD Cloud VPS Servers from €10.00/month
.
VPS SSD Cloud from €10.00 *** Dedicated Servers *** CS-Cart Authorized Reseller and Web Hosting Provider


 
  • teosu
  • Senior Member
  • Members
  • Join Date: 09-Oct 14
  • 395 posts

Posted 04 April 2018 - 06:43 AM #50

root@server:~# curl -I http://demo.cs-cart.com/
HTTP/1.1 403 Forbidden
Server: nginx
Date: Wed, 04 Apr 2018 06:42:42 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Powered-By: PHP/7.0.4-1+deb.sury.org~trusty+1
Set-Cookie: _csrf=591076c095f00bcc5c47bb00fa8635ed471581657acc3780ea619457747b392fa%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22cyEEfZE-uIMVMUSJA2jhhXKO3Ya7BVUR%22%3B%7D; path=/; HttpOnly

it does not seem to use varnish.



 
  • imac
  • Head of Product
  • CS-Cart Architects
  • Join Date: 22-Nov 05
  • 2043 posts

Posted 11 April 2018 - 06:12 AM #51

will the free addon be updated for newer versions ?

At the moment we do not have plans to update this add-on. 


Ilya Makarov,
CS-Cart Architect Team
Suggest and vote for new features | Report a bug