Plugin

Archived
Forum
(read-only)

Cache Buster

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Focus Lab, LLC

     

Nest this tag?

Support Request

WebDev777
WebDev777

Hey Erik,

It seems this is just the thing I need for my js files. Can you tell me, should this work?

[removed][removed] 

It is not currently, but not sure where the problem is.

Thx.

WebDev777
# 1
WebDev777

Hmm. Code was removed with code tags? Also without code tags. I’ve attached and image instead.

ErikReagan
# 2
Developer
ErikReagan

Hi there

At first glance I’d expect it to work. I’ll give it a test run and let you know what I find.

What version of EE are you running?

Thanks,
Erik

WebDev777
# 3
WebDev777

Hey Erik,

Any luck on this? Perhaps it would be more appropriate to just ask what the proper syntax is for js files and css…how you are implementing it. Not matter what I’ve tried, it fails. Viewing sources shows the relative path. At one time I was getting filemtime php errors. When I looked into it I found that according to comments in php documentation, filemtime returns false unless the path is absolute. So I’ve proceded on that basis but can’t yet determine the a way that actually does that. Currently trying this which also fails.

[removed][removed] 

Boy, this is frustrating. Can’t paste code in here no matter what it seems…..

ErikReagan
# 4
Developer
ErikReagan
WebDev777 - 11 July 2011 07:44 PM

Any luck on this?

Actually, I was hoping to test on the same exact version of EE so I was waiting to take action until I knew which version you were on.

WebDev777 - 11 July 2011 07:44 PM

...how you are implementing it

I suspect the issue is that the plugin doesn’t account for an EE template file to be passed to it. I may need to add some logic that checks for that somewhere along the way. I didn’t in the past because EE comes with its own cache buster for those stylesheet tags. I hadn’t considered trying it with js templates though.

That said, we actually don’t use this anymore. Rather than just add a cache buster to the filename we minify our scripts with John Wells’ Minimee (http://devot-ee.com/add-ons/minimee/)

I’d recommend giving that a look. If you’d like, I can still check into an update for EE 2.2+

What do you say?

WebDev777
# 5
WebDev777

Ooops. Sorry, I’m using EE 2.2.

So if you use minimee does that automatically bust the cache?

ErikReagan
# 6
Developer
ErikReagan
WebDev777 - 11 July 2011 08:05 PM

So if you use minimee does that automatically bust the cache?

Not necessarily, but it does create a unique cache file each time it is executed. So for us, we change our stylesheets and js files locally for testing and then deploy those changes to our staging and production servers. Upon deployment we automatically clear the Minimee cache files from the server which causes new ones to be created on the next page load. The new file name is relative to the time it is created so it effectively “busts the cache” of the file, since it is actually a new file.

ErikReagan
# 7
Developer
ErikReagan
WebDev777 - 11 July 2011 08:37 PM

Wow, this is a great find! Thanks very much for pointing it out. It will kill 2 birds with one stone!

Cheers,

Mark

No problem! That’s exactly why I don’t use my own plugin any more :)

WebDev777
# 8
WebDev777

Wow, this is a great find! Thanks very much for pointing it out. It will kill 2 birds with one stone!

Cheers,

Mark