Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

nocache for a file out of smarty/apache scope?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
smoretti
Smarty n00b


Joined: 16 Oct 2015
Posts: 2

PostPosted: Fri Oct 23, 2015 9:54 am    Post subject: nocache for a file out of smarty/apache scope? Reply with quote

Hi

I want to include a basic text file in a page but don't want it to be cached.
The file is out of Smarty and Apache scope.

I tried
Code:
{include file='/var/tmp/list_main_db.txt' nocache}

or
Code:
{nocache}
{include file='/var/tmp/list_main_db.txt' nocache}
{/nocache}

without any success, the file is never up-to-date.

I use Smarty 3.1.1 on Linux.

Any idea how to solve this?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Oct 24, 2015 10:05 pm    Post subject: Reply with quote

It should work. Does Apache the right permissions to access the file?

If it's plain text you could read the file in PHP and assign its content to a nocache variable.
Back to top
View user's profile Send private message
smoretti
Smarty n00b


Joined: 16 Oct 2015
Posts: 2

PostPosted: Mon Oct 26, 2015 8:11 am    Post subject: Reply with quote

Code:
It should work. Does Apache the right permissions to access the file?

Yes, the file is readable by all.
And if I remove manually cached files, it is read.

Code:
If it's plain text you could read the file in PHP and assign its content to a nocache variable.

I am far from a PHP master. How do you do that?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP