Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache refreshing ? #13

Closed
pluxain opened this issue Mar 11, 2017 · 3 comments
Closed

Cache refreshing ? #13

pluxain opened this issue Mar 11, 2017 · 3 comments

Comments

@pluxain
Copy link

pluxain commented Mar 11, 2017

Hi,

When I update a view I don't see the modifications reflected in the browser.

I configure the php directive opcache.revalidate_freq=0. The file timestamp is correctly modified on the machine.

The only way to see the modifications is to manually clear the cache folder in the project.

Anybody knows a workaround for this ?

@pluxain
Copy link
Author

pluxain commented Mar 13, 2017

I wrote this little test and it fails, even when the sleep step is active.

// tests/views/refresh.blade.php file containing "Initial content"

public function testRefresh()
{
    $initial_output = $this->blade->make('refresh')->render();
    $this->assertEquals(
        'Initial content', 
        trim($initial_output), 
        'The view output is equal to the file initial content'
    );

    $this->modifyView('Modified content', 'refresh');
    // sleep(1); // wait 1 second to make sure...
    $refreshed_output = $this->blade->make('refresh')->render();
    $this->modifyView($initial_content, 'refresh');
    $this->assertEquals(
        'Modified content', 
        trim($refreshed_output), 
        'The view output is equal to the file modified content'
    );
}

// ...

private function modifyView($content, $view_name)
{
    $view_path = "{$this->blade->viewPaths}/{$view_name}.blade.php";
    file_put_contents($view_path, $content);
}

@pluxain
Copy link
Author

pluxain commented Mar 13, 2017

This has nothing to do with your package, sorry. It has something to do with the virtual machine server configuration I use... If I use the PHP server everything works perfect !

@pluxain pluxain closed this as completed Mar 13, 2017
@pluxain
Copy link
Author

pluxain commented Mar 14, 2017

In case someone has the same issue, as I said it had nothing to do with this package !

It was "just" a write access problem to the cache folder and the files created. I am currently using a vagrant virtual machine and I fixed the problem by changing the user and group executing apache server to vagrant in /etc/apache2/envvars file.

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

No branches or pull requests

1 participant