Do you have some feature in mind that you'd love to see in Couch? Let us know.
6 posts Page 1 of 1
I have a root htaccess file with:
Code: Select all
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 0 seconds"
ExpiresByType image/jpeg "access plus 2 weeks"
</IfModule>
Lets say I have a clonable template with an 'image' and associated 'thumbnail' editable region. I upload the image. The 'image' is initially requested as: 'image.jpg' and the 2 week expires is sent with it. I hit save on the cloned page. The page reloads, and the 'thumbnail' is requested as: 'image-200x100.jpg' and the 2 week expires is also again sent with it. At this stage even if the 'image' file has been resized, my browser will continue to use the original cached 'image.jpg' as expected. Similarly, for the 'thumbnail' file after selecting a different 'crop position', my browser will continue to use the original cached 'image-200x100.jpg' as expected after saving the cloned page. On thumbnail recreation, I can see that couch utilizes a 'rand' querystring to bust any present cache-control. However this will as expected not effect the non-querystring version.

I know a simple refresh will result in the updated image and thumbnail files being sent, but I can't expect my client knowing when to do that. Without turning off expires for my '/uploads/image/' folder, can I get around this? Is there a way I could apply "access plus 0 seconds" or a redirect to a random querystring'ed version based on the referrer being from my couch directory? Hopefully I am missing a simple solution.

Oh... and Google's reCAPTCHA: http://www.google.com/recaptcha. It would be nice to be able to use that, as I am reluctant to use couch's captcha partially because it reveals the location of the couch directory through the captcha image.

** Sorry, accidentally posted this in the wrong section. You can move it if you like.
Can't see any straightforward way of doing this.
Apache 2.3 has an <If>..</If> directive (http://httpd.apache.org/docs/trunk/mod/core.html#if). Perhaps that could be used to check for the referrer and then conditionally use the 'ExpiresByType' directive. Haven't tested this out, though.
The host I'm using at the moment is running Apache 2.2. The 'if' directive does sound promising for this situation nevertheless. I'm not sure it's the route you would like to take, but if all 'image' and 'thumbnail' editable regions in the admin panel were generated with the 'rand' query string, caching could be prevented. I see this as more preferable than disabling caching for the 'uploads/image' folder.

On a side note, I think it would be a good idea to have some sort of visual indicator on the template sidebar of the number of un-approved comments. This would prevent people from needing to click on the comments sidebar item to see if there are any new comments. In addition, I think it would be neat to be able to specify a custom image for each template in the sidebar. This would be similar to how 'Comments', 'Users', and clonable templates display a 16x16 image to the left of their respective text title.

** Edit: I meant to say the use of cached images could be avoided, not that caching could be avoided.
I'll definitely look into if adding the random value helps.

As for the new comments indicator - I have been trying to get myself do that for a long time now :)
The sidebar is also due for a make-up - allowing grouping of templates, separator between templates and now, as suggested by you, the icons.
Hopefully the next version should have all these in.
In retrospect the icons may have been a silly request, considering the fact that CSS can do this quite easily while allowing for even greater flexibility/customization than a static icon would.

navigation-icons.jpg
navigation-icons.jpg (13.14 KiB) Viewed 4817 times

couch/theme/styles.css:
Code: Select all
.templates a[title="404.php"]{background:url(images/icons/page-error.png) no-repeat 43px 7px}

.templates>.active-template>a[title="404.php"]{background:url(images/icons/page-error.png) no-repeat 43px 7px,url(images/arrow.gif) no-repeat scroll 15px 3px}

Icons courtesy: http://led24.de/iconset/
You could also try: http://famfamfam.com/lab/icons/silk/
Nevermind... The title attribute for the navigation links is only generated for the super admin. There doesn't appear to be any way to target them for normal administrators with the current markup. Feature request? :P Perhaps some attribute that is consistent across all user levels. It doesn't even really have to be something functional like a title, it could just be a class or the rel attribute.

** Final Correction :lol:
CSS3 has some new selectors that can make this work:
Code: Select all
For clonable templates use this method:
.templates a[href$="tpl=5"]

For non-clonable templates use this method:
.templates a[href*="tpl=5&"]
Replace 5 with your template number.
6 posts Page 1 of 1
cron