News:

Looking for documentation? Take a look on our wiki

Main Menu

Clear the cache after changing the VM design

Started by Iryn3l, May 18, 2020, 13:24:13 PM

Previous topic - Next topic

jenkinhill

#15
If it is a browser cache issue, ie when you clear the browser cache you can see the changes, then it is the browser that must be attacked. I use 3 different browsers to check site changes and do see browser cache problems periodically. Does not bother me, though. When I notify a client that I have made changes to a page on their site I always include a ctrl+f5 instruction.

What about https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Iryn3l

I renamed template.css (works like this)
it's the only solution for me
Thank You

pinochico

Is not good solutions.
You must add timestamp for JS and CSS programmatically and setup Expires in httacess.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Studio 42

I use versionning. For .eg template.css?v1.0.0 to prevent old css or javascript in the browser cache
Or template.1.0.0.css

pinochico

Patrick:
QuoteI use versionning. For .eg template.css?v1.0.0 to prevent old css or javascript in the browser cache
Or template.1.0.0.css

Interestingly.
I just don't know how to do it, when we have 382 changes in css in the last six months and it is generated automatically from less files by the T3 framework.
That probably doesn't work, does it?

Timestamp sounds better to me, I don't have to deal with 382 versions, because I set it up in php once and I don't care anymore.
It may be the right option for manually created css, but I doubt it is a universal solution for us as well.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Studio 42

@Pinochico
You can add the versioning as a parameter in your template for .eg, but in my case, it's more when i add own css or javascript files in my extensions.

pinochico

Patrick:

Thanks, templates form Joomlart (base on T3 framework - we use it), create verisoning self - after any change in less or JS files, then generate css and js file with generated number of version.
So I don't care about this :)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

AH

#22
Just thought I would add my ten cents worth:

As far as I am aware - "managing versions" requires a very small one time effort using Joomla native support and letting php (at load time) add a differentiator for version.  I dont want my editor or myself to be responsible for versioning.

When I upload a css or js file to my live server, I want all visitors to get this version and for any prior cached versions to become irrelevant. 

Joomla allows for this:-

$document->addStyleSheet("...demo.css", array('version'=> yourversionstuffhere etc..

I want a "code and forget" function.

So just adjust  - "yourversionstuffhere" -  and create an appended version that includes php's file content modified information.

$doc->addStyleSheet('...yourcssfile.css',  array('version'=> 'ver='.date("YmdHis", filemtime('...yourcssfile.css'))));

result = yourcssfile.css?ver=20200501104344

Of course, you must provide the correct path to your css file!

Exactly the same approach can be used for js files.

Thereafter - everytime you upload the file, it will be re-versioned - no matter how many times you upload it.

Regards
A

Joomla 3.10.11
php 8.0

pinochico

AH:

but you don't use automatic generated finally css from template T3-framework, isn't it?
You write info only about our custom css added for component, module, fonts, but not from bootstrap T3-framework template :)
That is not correct for me, I have only one output css file minimized from every css files on the eshop and minimized version generated template automatically :)

Yes, about version by date and time in php  I wrote in my previous post, that is correct, thanks for your ode.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

AH

Pinochio
QuoteThat is not correct for me, I have only one output css file minimized from every css files on the eshop and minimized version generated template automatically

And that is a good thing to have.

However if you have your own template, auto generated versioning may not exist and can be a pain!

So i wanted to add another persons view for those who may be wondering why customer browser caching is happening (possibly as a result of  apache server mod_expires )
And what they might be able to do to resolve it :-)
Regards
A

Joomla 3.10.11
php 8.0

pinochico

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Iryn3l

Quote from: pinochico on May 20, 2020, 16:19:25 PM
Is not good solutions.
You must add timestamp for JS and CSS programmatically and setup Expires in httacess.


why isn't it a good solution?

pinochico

Today I optimalized one onepage website.
And created cca. 48 update css files.

What do you think?
48 x manually change file names or automatically added timestamp? :)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

AH

Quotewhy isn't it a good solution?

Because it is manual and you have to create a new name every time!

With a date/time option in your template/modules - you dont need to change the filenames - just upload the file

Regards
A

Joomla 3.10.11
php 8.0

Ventsi Genchev

Here's what I use to avoid this problem:

The timestamp method is very useful, but so that I don't have to add it everywhere, I use JCH Optimize Pro.
Since it combines the css files, whatever changes I make, it is enough to change the version of template.css in the index.php file. Or upload it again if a timestamp is used.
Changing the version causes JCH to compile all the files again and thus refreshes them.

In addition, with a good setup, it greatly improves the evaluation of the site in Google PageSpeed Insights.
It also removes comments in files and adds photo sizes where they are missing.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English