File Auto-Versioning (CSS, JS, etc) for Templates [Support Thread]
Starting with Zen Cart® 1.5.2, additional rules have been added to your store's /includes/.htaccess instructing the customer's browser to cache images, PDFs, CSS and javascript files for certain periods. While that caching provides your site with a performance "boost", it's not without cost … what happens if you've added a plugin that adds some styling to your current template's stylesheet.css? The short answer is that until the customer specifically refreshes their browser or clears their browser's cache (possibly multiple times), those changes won't be pulled from your site because the browser has been told to cache that file's contents!
That's where File Auto-Versioning comes into play. You can use this plugin to add a version string to those file "assets" so that your customers' browsers are always pulling in the most recent content.
I'll be submitting this to the Plugins in a bit and will update this support-thread once I've got a download link.
Re: File Auto-Versioning [Support Thread]
Here's the link for the Zen Cart Plugins download (once reviewed): https://www.zen-cart.com/downloads.php?do=file&id=2116
Re: File Auto-Versioning [Support Thread]
Would it be safe to say this should be called "Asset Auto-Versioning" instead of merely "File Auto-Versioning"?
Re: File Auto-Versioning [Support Thread]
Quote:
Originally Posted by
DrByte
Would it be safe to say this should be called "Asset Auto-Versioning" instead of merely "File Auto-Versioning"?
Kind of, sort of ... I guess. The point is that the auto-version is the return value from the PHP filemtime function, so whether its a file or an asset there's a file involved.
Re: File Auto-Versioning [Support Thread]
Agreed. I was looking at it from the perspective of someone looking at a list of plugins and trying to understand what they do by their name, and deciding whether they might need to install it on their shop. It felt like "file versioning" might imply "managing versions of every file in my Zen Cart", thus maybe more of an upgrader-tool.
This is more of a "cache-buster" by adding a version stamp to the URL.
Just passing along my observation.
Re: File Auto-Versioning [Support Thread]
Quote:
Originally Posted by
DrByte
Agreed. I was looking at it from the perspective of someone looking at a list of plugins and trying to understand what they do by their name, and deciding whether they might need to install it on their shop. It felt like "file versioning" might imply "managing versions of every file in my Zen Cart", thus maybe more of an upgrader-tool.
This is more of a "cache-buster" by adding a version stamp to the URL.
Just passing along my observation.
I agree with Dr Bytes assumption. When I saw this thread I thought it updates the version number in PHP files. I'd go a little beyond and say Browser Asset Auto Versioning.
Re: File Auto-Versioning [Support Thread]
Module not yet available so I cannot find out details but here is my question.
stylesheet.1194900443.css <- is this similar to what the filename will look like using the module?
If yes, perhaps "Filename Revisioning" would be more applicable as a Module name?
Re: File Auto-Versioning [Support Thread]
The plugin (see its GitHub repository for the current readme) doesn't actually modify any files, it simply generates an HTML attribute containing the file's last-modified time (e.g. stylesheet.css&293729837) to "trick" the browser into grabbing the updated file's contents.
Re: File Auto-Versioning [Support Thread]
Quote:
Originally Posted by
DrByte
Agreed. I was looking at it from the perspective of someone looking at a list of plugins and trying to understand what they do by their name, and deciding whether they might need to install it on their shop. It felt like "file versioning" might imply "managing versions of every file in my Zen Cart", thus maybe more of an upgrader-tool.
This is more of a "cache-buster" by adding a version stamp to the URL.
Just passing along my observation.
Quote:
Originally Posted by
numinix
I agree with Dr Bytes assumption. When I saw this thread I thought it updates the version number in PHP files. I'd go a little beyond and say Browser Asset Auto Versioning.
Thanks, guys, I'll go with @numinix's "a little beyond" as it fully describes the plugin's function. I'll get that name changed for the next go-round.
Re: File Auto-Versioning [Support Thread]
Quote:
Originally Posted by
lat9
v1.0.0 is now available for download.