Skip to content

Conversation

@Murnto
Copy link

@Murnto Murnto commented Aug 1, 2016

See #5

@s-ludwig
Copy link
Member

s-ludwig commented Aug 1, 2016

How about using something like .replace('/', '_'), so that deeper nestings also work?

BTW, do nested string imports directories work on Windows for the latest DMD versions? They used to work only on other systems, but there was an effort to remove that restriction recently.

@Murnto
Copy link
Author

Murnto commented Aug 1, 2016

If cached views are going to be decoupled from their templates, why not place them in a special directory like /views/_cached_/ to avoid polluting /views/?

BTW, do nested string imports directories work on Windows for the latest DMD versions?

I don't run windows to be able to tell you.

@s-ludwig
Copy link
Member

s-ludwig commented Aug 1, 2016

why not place them in a special directory like /views/cached/ to avoid polluting /views/?

Basically just because of the Windows path issue. I'll have to try this out in the evening when I get access to a Windows machine.

@s-ludwig
Copy link
Member

s-ludwig commented Aug 3, 2016

Okay, finally got the chance to test and it still doesn't work on Windows. So for now, the _cached_ prefix needs to stay. But hopefully all of this will soon be obsoleted with the new CTFE engine.

@schveiguy
Copy link
Contributor

This still is a problem, and prevents using cached templates along with organizing your views into subdirectories.

A simple fix I thought of is to apply only a suffix to the filename instead of a prefix. So e.g.:

enum _diet_cache_file_name = filename~"_cached_"~_diet_hash.to!string~".d"

This would be immune to issues with paths in the filename. It's also a lot simpler than the building of a path. Make sense?

@schveiguy
Copy link
Contributor

See #72 for an alternate solution to this.

@schveiguy
Copy link
Contributor

This should be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants