sewpafly / post-thumbnail-editor

Wordpress Plugin to manually edit post thumbnails
http://wordpress.org/extend/plugins/post-thumbnail-editor/
32 stars 18 forks source link

Bypassing the server with varnish cache passing a variable 123 in each image #46

Closed leocaseiro closed 12 years ago

leocaseiro commented 12 years ago

Hi, I fixed my problem bypassing the varnish.

I use only one parameter? 123 to bypass the cache

My modification does not work with debug off.

sewpafly commented 12 years ago

It seems like this is something that you should probably change in varnish rather than the plugin... After googling, I saw a code snippet here, that mentioned you could turn varnish caching off for certain directories (or files) and that would be a good idea for this plugin. Especially as the 123 fix might not work next time.

if (req.request == "GET" && (req.url ~ "(wp-admin)")) {
    return(pipe);
}

Does something like this work?

leocaseiro commented 12 years ago

Unfortunately I have not access to the Varnish server. So I can't configure it. The ?123 param worked very well even running two times in a row. The user can see the image cropada before confirming. Just can not immediately see the image on the site, because of the cache. I have no access to Varnish, made ​​it possible to modify the least of your script.

That was the only way I found to circumvent it. I tried to find another solution, to create a random number, but then file_exists () not working. So always used? 123. If you have another solution would be great! If not, I'll leave at least well on this server.

Again, thanks for the help and the excellent plugin. I'm using it on more than 5 sites with WP.

Best Regards,

sewpafly commented 12 years ago

I see your problem. Well hopefully with git, it should be easy to merge this in with any future changes in the 1.0.x line. I'll keep this in mind as I move to 1.1.x.

Thanks for using the plugin. I'm glad it helps!